How can I close my GUI from a message box callback?
2 views (last 30 days)
Show older comments
I would like to be able to use a message box callback to close my GUI.
Accepted Answer
MathWorks Support Team
on 24 Jan 2017
You can create the msgbox and pass the handle of the figure into the callback of the DeleteFcn in the following manner:
h=msgbox('Goodbye')
set(h,'deleteFcn',{'test', gcf})
The callback of the DeleteFcn can be defined to be:
function test(src, eventdata, k)
close(k); % Close the figure
close(gcbf); % close the message box
0 Comments
More Answers (0)
See Also
Categories
Find more on Migrate GUIDE Apps 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!