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
main()
{
populate_screen_with_FLTK_widgets()
Fl:lock(); //enable lock() support
fl_create_thread(fct_with_loop);
return Fl:run();
}
fct_with_loop()
{
while()
{
while(dataNotReady)
{
getSomeDataWithPolling()
delay20ms()
}
putDataOnScreen()
}
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk