FLTK logo

[fltk.general] Re: New callback directly in command, difficulty

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.general  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: New callback directly in command, difficulty "'Matthias Melcher' via fltk.general" Jan 26, 2022  
  `sleep(100)` will not work. The correct version would be to pop open your window and return to the main call, and then react to events as they happen later. If you want the window to close after a certain time, even if the user did not click a button, you can create a timed callback with `Fl::add_timeout()`, but you must make sure to remove the timeout if the user closes the window in the conventional way.

It's not good style, but you can also busy-wait until the dialog is closed, something like:

`while (myWindow->visible()) Fl::wait();`

--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/8f80e534-0ce5-4f77-a57f-9321f5d1c593n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.