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?

 Akzeptierte Antwort

Use drawnow to force the figure to update
app.GetSpectraButton.Enable='off'
drawnow;
% .. do stuff
app.GetSpectraButton.Enable='on'

Weitere Antworten (0)

Kategorien

Mehr zu Develop Apps Using App Designer finden Sie in Hilfe-Center und File Exchange

Produkte

Version

R2020b

Gefragt:

am 14 Nov. 2020

Kommentiert:

am 14 Nov. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by