| View previous topic :: View next topic |
| Author |
Message |
thomas Newbie
Joined: 15 Jan 2003 Posts: 23 Location: Germany
|
Posted: Tue Apr 15, 2003 10:07 am Post subject: close dialog |
|
|
Hello,
I want to close a dialog. The follow script does not do this. I get always the "window is open"-message. Whats wrong?
dialog create,dialog1,0,0,0,0,Class dialog1
if @winexists(dialog1)
window close,dialog1
window hide,dialog1
if @winexists(dialog1)
dialog close
if @winexists(dialog1)
info Window is open
end
end
end |
|
| Back to top |
|
 |
Skit3000 Admin Team

Joined: 11 May 2002 Posts: 2166 Location: The Netherlands
|
Posted: Tue Apr 15, 2003 3:03 pm Post subject: |
|
|
This should work for you. The problem was that if you send a CLOSE command to a VDS script, it will be stored in @event(). TO read it you should have a kind of :Evloop (Event-loop)...
| Code: | dialog create,dialog1,0,0,0,0,Class dialog1
dialog show
goto Closewindow
:Evloop
wait event
goto @event()
:Close
exit
:Closewindow
if @winexists(@winclass(dialog1))
window close,@winclass(dialog1)
end |
_________________ [ Add autocomplete functionality to your VDS IDE windows! ]
Voor Nederlandse beginners met VDS: bekijk ook eens deze tutorial! |
|
| Back to top |
|
 |
Garrett Moderator Team
Joined: 04 Oct 2001 Posts: 2149 Location: A House
|
Posted: Tue Apr 15, 2003 6:37 pm Post subject: |
|
|
If this is the only dialog in use, then you must use "EXIT" or "STOP" to
end your program.
If this is a second dialog from your main dialog, then
DIALOG SELECT,1
DIALOG CLOSE
%E = @event()
will do the job. If you are trying to use the DIALOG CLOSE on your
main window, then this is not going to work. If you don't want the
main dialog showing anymore, then use
WINDOW HIDE,#dialog1
And if you need to bring it back, use
WINDOW NORMAL,#dialog1
-Garrett |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You can attach files in this forum You can download files in this forum
|
|