How can I close my GUI from a message box callback?

2 views (last 30 days)
I would like to be able to use a message box callback to close my GUI.

Accepted Answer

MathWorks Support Team
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

More Answers (0)

Categories

Find more on Migrate GUIDE Apps in Help Center and File Exchange

Products


Release

R14SP1

Community Treasure Hunt

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

Start Hunting!