Julia Dudascik (Contractor)
2016-08-04 18:27:47 UTC
I have recently created a FXProgressDialog to show the status of opening a
large file. If use the execute() command, the dialog with the progress bar
appears, but the code following it to open the file does not execute. If I
run fxtrace I can see that FOX events are still being processed, but my
code is stuck until execute returns.
What I had to do instead, is call create() then show() for my
FXProgressDialog. Then, in order to ensure FXProgressDialog displays before
the code starts to open the file, I have to call refresh() and afterwards
runWhileEvents(). This successfully displays the FXProgressDialog. As the
file opens I call refresh() and runWhileEvents() so that it shows the
status of the open.
I have several questions:
1.) Is there a way to use the execute() function so that it continues to
process my code and re-paint the progress bar while it is in this
runModalFor loop?
2.) Is what I am doing the best way to go about this? I don't want to run
into an issue where runWhileEvents takes a long time, causing my file open
time to take twice as long.
3.) If I use the function runUntil(condition), how do I set the condition
to a non-zero value so that it will then continue processing my code?
Thank you
Julia
large file. If use the execute() command, the dialog with the progress bar
appears, but the code following it to open the file does not execute. If I
run fxtrace I can see that FOX events are still being processed, but my
code is stuck until execute returns.
What I had to do instead, is call create() then show() for my
FXProgressDialog. Then, in order to ensure FXProgressDialog displays before
the code starts to open the file, I have to call refresh() and afterwards
runWhileEvents(). This successfully displays the FXProgressDialog. As the
file opens I call refresh() and runWhileEvents() so that it shows the
status of the open.
I have several questions:
1.) Is there a way to use the execute() function so that it continues to
process my code and re-paint the progress bar while it is in this
runModalFor loop?
2.) Is what I am doing the best way to go about this? I don't want to run
into an issue where runWhileEvents takes a long time, causing my file open
time to take twice as long.
3.) If I use the function runUntil(condition), how do I set the condition
to a non-zero value so that it will then continue processing my code?
Thank you
Julia