In article <[EMAIL PROTECTED]>,
Nicholas Schwarz <[EMAIL PROTECTED]> wrote:
> Hi again,
>
> I'm seeking some advice about how to use threads with FLTK, preferably
> without using FLTK's built-in lock and unlock features. A thread that opens a
> socket will execute callbacks based on incoming messages. Those callbacks
> have to update widget values. Is it possible to make a message queue using
> FLTK's event handlers? I really don't like the idea of replacing Fl::run with
> a loop that polls a condition variable, but don't know of another way to do
> it.
Yes, you can do that in the upcoming 1.1.8 (current 1.1.x from svn).
You can use the built-in queue provided by Fl::awake/Fl::set_awake_cb,
which provides "several thousands unreliable messages" to be queued.
If you need greater control, you can implement your own by using a
custom queue and awake() solely to interrupt Fl::run().
There's a new chapter in the documentation ("Advanced FLTK") which
discuss those functions in more detail.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk