On 31.12.2009, at 02:09, leowang wrote: >> Dear All, >> I found that when I call redraw in a thread, it will not really redraw, the >> UI does not refresh untill we have handle on the window. why? Does it mean I >> only can call redraw in main thread? >> >> Thanks. > > my fltk version is v2.0
After calling redraw(), call fltk::awake(0). This will make the main thread aware of your request. It would be best to use locking as well. Just before fltk::run() call fltk::lock(). Then, in your thread, before you change any widgets, call fltk::lock(); myWidget->stuff... myWidget->redraw(); fltk::unlock() fltk::awake(0); Remember that you can not create or destroy windows from within a thread! Matthias _______________________________________________ fltk mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk

