Is there a easy way to implement a PogressBar in MainLoop (Desktop.app) process?
You know the answer, don’t you?
The only way I see ain’t easy.
- Start a Helper.app
- MainLoop writes data to file
- Helper.app shows dialog, writes to file if Stopp-Button pressed
- MainLoop reads file
- Goto 2 until done
Running in Thread is no option, speed to slow.
I can think about three ways:
- doing work on main thread, calling refresh and update now to have progress dialog redraw. (bad)
- running a timer to do work with a small delay like 10ms and have it process one item at a time and move progress bar (better)
- running a thread to work items and set property with current value. Timer updates progress dialog once a second to newer value.
That is by far the best solution
1 Like
It always depends on the things you do.
But the timer doing one at a time is a good thing if processing can’t run in a thread.
do the job. Thanks for help.