On 29 May 2009, at 22:08, Loic wrote: > > Is there anyway to use a function in a while instead of Fl::run(); > For my application it will be more suited, because I have to make > other computation, absolutely not related to FLTK. And I don't > want to make this computation periodically but all the time. And > only refresh FLTK from time to time and when needed.
Sure, you can do that, although I would not, I'd use threads. Others, like Greg (at a guess, as he's less keen on threads) might do something using Fl::add_timeout(). However, if you really don't want to use Fl::run() then all you *really* need to do to get fltk ticking along is to call Fl::check() every now and then from within your other computation, and all should be well. > But the redraw() should be called only to the main window, right? You can call redraw() on any widget, if you think it ought to be marked for update. If you call update on a container widget (group, window, etc.) then it will see to the update of its children too. _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

