ProgressWheel not working

I have a Shell command in a “Do Loop” loop, before the loop I declare a ProgressWheel but it remains invisible and inactive during the execution of the command. How to do ? Here is the code:

if ProgressWheelXPR.Visible = false then
  ProgressWheelXPR.Visible = true

if ProgressWheelXPR.Enabled = false then
  ProgressWheelXPR.Enabled  = true

sh.Execute xpfile.ShellPath
Loop Until Not sh.IsRunning

If exit_code = 0 Then 'Success

Thanks a lot

your loop chokes the gui, you should do your loop in a thread or simply do NOT do the loop at all. Xojo will raise an event on the Shell class once it get’s data automaticly.

As DerkJ says, your shell.intwraction is preventing this cycle from completing, so the GUI doesn’t get updated before the task begins.

Either move it to an Asychronous shell, or use timer.calllater to execute the loop after you’ve allowed the GUI update to occur.

1 Like

Thank you, I had tried without loop it does not work because the process is long.
Do you have an example of thread support?

Thanks, I didn’t know about Timer.CallLater().

If it does take long you can still use the events and activate the progresswheel on start and stop the progresswheel in the completed event