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

1 次查看(过去 30 天)
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 个评论
Adam
Adam 2018-11-8
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.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by