News : The level of daily SPAM has reached insane proportions, all registrations are now manual. I ask you to send me an e-mail (john (at) murga (dot) org), to confirm that you want me to create an account for you.


Post Reply  Post Thread 
Response from Message Box
Author Message
mikshaw
Senior Member
****


Posts: 522
Group: Registered
Joined: Apr 2007
Status: Offline
Reputation: 5
Post: #1
RE: Response from Message Box

Are you aware that Fltk has a built-in dialog that can be used in this way? The fl_choice dialog prevents access to its parent window until a choice is made, either by selection of one of the choices or by escaping out of the dialog.

In this example fl_choice is used as an exit confirmation. If "yes" is not chosen, the dialog closes and nothing happens. You could easily enough add a default condition, in case the user simply closes the dialog.

Code:
function my_exit()
  my_confirm=fltk.fl_choice("sure you want to quit?","no","yes",NULL)
  if my_confirm == 1 then os.exit(0) end
end
my_window:callback(my_exit)

07-31-2011 01:11 AM
Find all posts by this user Quote this message in a reply
Post Reply  Post Thread 

Messages In This Thread
Response from Message Box - ceeuu - 07-29-2011, 06:24 AM
RE: Response from Message Box - mikshaw - 07-30-2011, 12:15 AM
RE: Response from Message Box - ceeuu - 07-30-2011, 03:04 AM
RE: Response from Message Box - mikshaw - 07-31-2011 01:11 AM
RE: Response from Message Box - ceeuu - 07-31-2011, 11:09 AM
RE: Response from Message Box - roydobbins - 08-05-2011, 11:37 AM

View a Printable Version
Send this Thread to a Friend
Subscribe to this Thread | Add Thread to Favorites

Forum Jump: