Setting string in static text box requires a pause after setting otherwise doesn't update string

1 view (last 30 days)
I have found some odd behaviour in my GUIDE GUI recently that I can't find an answer to.
I have a static text box on my GUI that displays the program run status. When a button is pushed, a simulation starts that takes a few mins to run.
The first line of code in the callback for this button updates the static text to reflect that the simulation is running. Then the simulation code/calculations begin.
If I don't put a short pause (0.1 sec or so) after the "set" function line of code, the static text box string does not change. Why could this be?
  1 Comment
Adam
Adam on 8 Nov 2018
It's fairly standard that the UI does not constantly keep refreshing itself. A
drawnow
instruction should be sufficient, though I doubt it is much, if at all, faster than a 0.1s pause!
See
doc drawnow
for details.

Sign in to comment.

Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2015a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!