On 03.03.2008, at 14:13, Oguz Akyuz wrote:

> I know that to keep ui responsive (or update itself) we can use  
> Fl::check() in intensive computation loops. However, when such loops  
> are not written by ourselves, for instance when using an external  
> libraries, it is not possible to insert this statement into the loop  
> body.
>
> In my case I'm doing image loading/saving operations using external  
> libraries and I would like to keep the ui responsive while the image  
> is being loaded or saved. How can I ensure a responsive behavior in  
> such a case?


In that case you can use threading. The operating system will then  
take care of assigning some time to every task, including the GUI.  
FLTK give minimal supprt for threading, providing lock, unlock, and  
Fl::awake() to synchronize threads. FLTK2 additionally provides an  
interface to start and end threads.

Just make sure that the GUI thread is always the main thread. If you  
want to stay cross-platform, I suggest you use pthreads which should  
exist on every Unix machine and comes as a small library for MS Windows.

Matthias

----
http://robowerk.com/


_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to