How can I enable a button after another button's procedure has completed in App Designer?
15 views (last 30 days)
Show older comments
MathWorks Support Team
on 31 Aug 2017
Answered: MathWorks Support Team
on 1 Sep 2017
I am looking for an example that shows two things:
1. How to show an app is busy while computing something
2. How to enable a button after that computation is done
Accepted Answer
MathWorks Support Team
on 31 Aug 2017
Attached is a simple app that accomplishes this as an example. The relevant code is in the first button's callback:
function computeFunction(app, event)
set(app.NotComputingLabel, 'Text', 'Computing...')
% your computation
pause(3);
set(app.NotComputingLabel, 'Text', 'Done Computing!')
set(app.AccessibleAfterComputeButton, 'Enable', 'on')
end
You can set the second button to be disabled by selecting it in the Design View and changing the "Enable" property on the right, in the "Button Properties" section.
0 Comments
More Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!