How can i prevent a GUI from closing?

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?

Respuestas (1)

Sean de Wolski
Sean de Wolski el 15 de Abr. de 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.

Categorías

Más información sobre Creating, Deleting, and Querying Graphics Objects en Centro de ayuda y File Exchange.

Etiquetas

Preguntada:

el 15 de Abr. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by