On Wednesday, September 30, 2020 at 10:19:43 PM UTC+5:30 anmol....@gmail.com wrote:
Hi. I want to create a simple progress bar, and do not need any user input. I cannot block my main app as it already has its own GUI.
What will happen if I use the following from a worker thread ?
Fl_Window win(220,90);
win.begin(); // add progress bar to it..
Fl_Progress *progress = new Fl_Progress(10,50,200,30);
progress->minimum(0); // set progress range to be 0.0 ~ 1.0
progress->maximum(1);
progress->color(0x88888800); // background color
progress->selection_color(0x4444ff00); // progress bar color
progress->labelcolor(FL_WHITE); // percent text color
50
win.end();
And I update it from main thread.
progress->value(t/500.0);
progress->label(percent); // update progress bar's label
Fl::check();
I read the docs, and its clear that the main thread owns the window, but if I dont care about user input, is there any harm in this ?