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

2 ビュー (過去 30 日間)
Matt
Matt 2018 年 11 月 8 日
コメント済み: Adam 2018 年 11 月 8 日
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 Center および File ExchangeEnvironment and Settings についてさらに検索

製品


リリース

R2015a

Community Treasure Hunt

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

Start Hunting!

Translated by