Appdesigner button disable not working when called in side pushbutton callback

Hello. I have a pushbutton that I want to prevent the user from pushing agin until the current code has finished.
So I did this
function GetSpectraButtonPushed(app, event)
app.GetSpectraButton.Enable='off') % Disable any further presses of the button
% .. do stuff
app.GetSpectraButton.Enable='on') % Enable button
But its having no effect?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 11 月 14 日
Use drawnow to force the figure to update
app.GetSpectraButton.Enable='off'
drawnow;
% .. do stuff
app.GetSpectraButton.Enable='on'

2 件のコメント

Jason
Jason 2020 年 11 月 14 日
Thankyou
Ameer Hamza
Ameer Hamza 2020 年 11 月 14 日
I am glad to be of help!

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeDevelop Apps Using App Designer についてさらに検索

製品

リリース

R2020b

質問済み:

2020 年 11 月 14 日

コメント済み:

2020 年 11 月 14 日

Community Treasure Hunt

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

Start Hunting!

Translated by