forum.vdsworld.com Forum Index forum.vdsworld.com
Visit VDSWORLD.com
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


close dialog

 
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help
View previous topic :: View next topic  
Author Message
thomas
Newbie


Joined: 15 Jan 2003
Posts: 23
Location: Germany

PostPosted: Tue Apr 15, 2003 10:07 am    Post subject: close dialog Reply with quote

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
View user's profile Send private message
Skit3000
Admin Team


Joined: 11 May 2002
Posts: 2166
Location: The Netherlands

PostPosted: Tue Apr 15, 2003 3:03 pm    Post subject: Reply with quote

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
View user's profile Send private message
Garrett
Moderator Team


Joined: 04 Oct 2001
Posts: 2149
Location: A House

PostPosted: Tue Apr 15, 2003 6:37 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forum.vdsworld.com Forum Index -> General Help All times are GMT
Page 1 of 1

 
Jump to:  
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

Twitter@vdsworld       RSS

Powered by phpBB © 2001, 2005 phpBB Group