Appdesigner button disable not working when called in side pushbutton callback
10 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Jason
am 14 Nov. 2020
Kommentiert: Ameer Hamza
am 14 Nov. 2020
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?
0 Kommentare
Akzeptierte Antwort
Ameer Hamza
am 14 Nov. 2020
Use drawnow to force the figure to update
app.GetSpectraButton.Enable='off'
drawnow;
% .. do stuff
app.GetSpectraButton.Enable='on'
2 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Interactive Control and Callbacks finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!