Terminating script after closing GUI window.
Mostrar comentarios más antiguos
Hi,
my problem is that when Im trying to close my GUI window through the close request function, the script is still going and it spits out an error, because the object it's trying to access is already deleted.
Is there a way to terminate the script in the closing function? In the main program you can do return; pretty easily but here I'm unsure.
I'm using delete(hObject) / delete(handles.figure1)
Could you please help me?
Thank you.
:)
3 comentarios
Geoff Hayes
el 6 de Abr. de 2015
Mark - what script are you trying to stop? Please include all code in your close request function as well as the full error message.
Mark
el 8 de Abr. de 2015
Ali
el 14 de En. de 2016
I have the same problem. Did you find out how to fix it Mark?
Respuestas (1)
Walter Roberson
el 15 de En. de 2016
0 votos
No, callbacks have no direct way of instructing running functions to do anything. Running functions need to query whether they have been asked to do something. For example they could ask whether their figure handle is still valid.
If you are using R2014b or later you can use isgraphics() to determine whether something is a valid graphics handle. If you are using an earlier MATLAB then use ishandle()
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!