> I already have a thread going that is handling the polling of
> the shared memory and writing it to a local property pixbuf.
> The problem is that even though the thread calls for the
> redraw method of the Fl_Box on every cycle of the thread. It
> only redraws if the mouse is being moved which is exceedingly odd.
Would help a bit if you told us which version of fltkm and what host
platform.
Anyway, guess mode on:
I am assuming that you are using fltk-1.1.8. Have you read chapter 10 of
the manual, which covers multi-threading support in fltk-1?
In summary, only the "main" thread can access the GUI layer (for
cross-platform portability reasons), so calling redraw() from a non-GUI
thread is not guaranteed to work.
What you need to do instead is something like this.
- From your main GUI thread, before you show your first window, call
Fl::lock(); *just once* (and do not call unlock in themain thread at
all) this will wake up fltk's threading support.
- From your helper thread, each time you need to modify a widget in the
GUI thread, do this sequence.
Fl::lock();
<widget changes>
Fl::unlock();
Fl::awake();
Do not call redraw(); at all from the helper thread, as it won't do what
you want...
Cheers,
--
Ian
SELEX Sensors and Airborne Systems Limited
Registered Office: Sigma House, Christopher Martin Road, Basildon, Essex SS14
3EL
A company registered in England & Wales. Company no. 02426132
********************************************************************
This email and any attachments are confidential to the intended
recipient and may also be privileged. If you are not the intended
recipient please delete it from your system and notify the sender.
You should not copy it or use it for any purpose nor disclose or
distribute its contents to any other person.
********************************************************************
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk