How can i prevent a GUI from closing?
Show older comments
I am currently creating a Graphical User Interface with several pushbuttons. When selecting one of the buttons, the GUI closes and runs an m file (opens an image, permits the user to select points on it and saves the data into a separate file). How can I prevent the GUI from closing as I want to use another button to perform further operations with that saved data?
Answers (1)
Sean de Wolski
on 15 Apr 2013
Set the figure's CloseRequestFcn to [];
h = figure;
surf(peaks);
set(h,'CloseRequestFcn',[]);
Note, this isn't fool proof, the CloseRequestFcn could be set back to the default or a:
close all force
would clean it out as well.
Categories
Find more on Creating, Deleting, and Querying Graphics Objects 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!