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

조회 수: 4 (최근 30일)
憲志郎 堀内
憲志郎 堀内 2022년 6월 28일
댓글: 憲志郎 堀内 2022년 6월 28일
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일
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개)

카테고리

Help CenterFile Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

제품


릴리스

R2022a

Community Treasure Hunt

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

Start Hunting!