|
|
Wouldnt Fl::run() block the main loop though ? Thats what I am trying to avoid as its a loop that processes lots of data.
On Thursday, October 1, 2020 at 7:09:47 PM UTC+5:30 lifeatt...@gmail.com wrote:
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/c9fb305b-3e7e-4000-bb4f-df747df70080n%40googlegroups.com.
[ Direct Link to Message ] | |
|
| |