処理実行中のみボタンのテキストを変更するには

AppdesignerでGUIアプリの開発をしています。
ボタンをクリックした後、時間のかかる処理を行いたいと考えています。
このときボタンの表示をrun→runningに変更する必要があります。
以下のコードを実行しましたが、ボタンの文字の更新が行われません。
function ButtonPushed(app, event)
app.Button.Text = 'running';
calculate();
app.Button.Text = 'run';
end
文字の変更後、画面をリフレッシュする必要があると思うのですが方法が分かりません。

 采纳的回答

Kojiro Saito
Kojiro Saito 2022-6-28

2 个投票

drawnowという関数でFigureの表示を更新できます。
calculateの前にdrawnowを入れてみてください。
function ButtonPushed(app, event)
app.Button.Text = 'running';
drawnow
calculate();
app.Button.Text = 'run';
end

1 个评论

憲志郎 堀内
憲志郎 堀内 2022-6-28
素晴らしいです。drawnow一行で解決しました。
ご回答ありがとうございます。

请先登录,再进行评论。

更多回答(0 个)

类别

帮助中心File Exchange 中查找有关 Deep Learning Toolbox 的更多信息

产品

版本

R2022a

标签

Community Treasure Hunt

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

Start Hunting!