> To integrate the above with FLTK is probably best done with > either a thread, or creating your own Fl::run() loop using > Fl::wait() with some small timeout, so you can poll back and > forth between FLTK and the serial port.
Oh yes, that's a point - serial comms is very slow, so you do need to "detach" it from the GUI interaction in some way. I always use threads for this, but I guess polling in a timeout would work OK too, and be simpler to set up. <pointless anecdote alert> Although, on the "detach it from the GUI" front ... We were integrating a remote display with a touch screen, that reported the screen touches via RS-232. So my code had a thread that serviced the RS-22 port, then interpreted the messages and stuffed them back into the operating system's mouse interface which, of course, then delivered them back to fltk as mouse events... So that was "detached" in a coupled sort of way... I could have handled the screen touches directly, but converting them into mouse events was easier... </pointless anecdote alert> -- 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-dev mailing list [email protected] http://lists.easysw.com/mailman/listinfo/fltk-dev
