|
|
I've had some success with a message-based system.
In the forked process I invoke Fl::handle_() with a custom message code. In the main code I establish a handler using Fl::add_handler(). Fl::run() operates as normal. Something like:
int progress_update(int event) { progress->value((float)event_data); // using FL's event_data global for data transfer
char percent[10] = {""}; sprintf_s(percent, "%d%%", (int)event_data); progress->copy_label(percent); }
int main() { Fl::add_handler(progress_update); // create window as shown earlier Fl:run() }
and in the worker thread: event_data = t / 500.0; Fl::handle_(PROGRESS_UPDATE,0);
--
You received this message because you are subscribed to the Google Groups "fltk.general" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkgeneral+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkgeneral/11b3b890-2fb7-4aed-b330-722ca6ae6596n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |