Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Exit a Program
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
syntax0r




PostPosted: Sun May 08, 2005 10:56 pm   Post subject: Exit a Program

Im wondering if there's an efficient, user-friendly way for someone to exit a turing application?

I could make an option to close a window, but I am not sure the .EXE will be closed.

Then there's the
code:
  var buttonQuit : int := GUI.CreateButton (maxx div 2 - 51, maxy div 2 - 120, 0, "Quit", GUI.Quit)
which does not actually "close" the window, just terminates the app.

Im stuck, any suggestions?
Sponsor
Sponsor
Sponsor
sponsor
Tony




PostPosted: Sun May 08, 2005 11:55 pm   Post subject: (No subject)

what GUI.quit does is it makes GUI.ProcessEvents return true.
[Gandalf]




PostPosted: Mon May 09, 2005 12:35 am   Post subject: (No subject)

code:

var window : int
window := Window.Open ("position:center;center,graphics:max;max")
Window.Close (window)

*oops, should have read that better Embarassed *

well... it does close the .exe - its not in the processes anymore...
Token




PostPosted: Mon May 09, 2005 2:26 pm   Post subject: (No subject)

i'm not sure exactly how gui works but you could make it so that when quit returns a gui action or whatever var q:= true, and have in all your loops,

code:


if q= true then
exit
end loop


and then at the very end do the window close thing and ur set.
MysticVegeta




PostPosted: Tue May 10, 2005 6:53 am   Post subject: (No subject)

Or you could do something like this ->
code:

var winID := Window.Open ("position:top;center,graphics:200;200")
loop
exit when GUI.ProcessEvent
end loop
Window.Close(winID)


So when the loop exits after pressing the GUI.Quit Button, the window closes.

Also what you can do is ->
After someone presses the Quit Button ->

code:
if GUI.GetEventWidgetID = quitBtn then
Window.Close(windID)
end if
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 5 Posts ]
Jump to:   


Style:  
Search: