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
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 Center 和 File Exchange 中查找有关 Startup and Shutdown 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!