On 11.11.2010, at 17:36, <[email protected]> <[email protected]> wrote:
> Hello, > What is the best way to add a delay function in a thread created with > fl_create_thread for FLTK 1.1.8 under win32? I'd like the GUI response to > run smoothly even when the delay is running. > > I need the delays to be in the 20ms-200ms range and it's not critical to be > accurate. The goal of the delay is just not to make the CPU give all its > processing power in a while loop. > > > I experimented with SleepEx() in the fct_with_loop and don't understand > totally how come it affects threads other than the one it is in.In my bigger > program, I created before running fct_wit_loop and the GUI response is pretty > sluggish. > > > > Thanks, > Frank Hmm, there is not much threading support in FLTK because there are so many other threading libraries out there. FLTK has a timer function, Fl::ad_timeout and Fl::repeat_timeout that may help you, but those are not made for multithreading You could still use them to set locks, etc. . FLTK 1.1.10 and FLTK 1.3 have a function that can be called from a thread and runs a function in the GUI thread: Fl::awake() with two arguments (callback and user data) - Matthias _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

