필터 지우기
필터 지우기

How do I force breaking from a modal GUI window?

조회 수: 2 (최근 30일)
Niko
Niko 2014년 10월 29일
답변: Orion 2014년 10월 29일
Hi all,
I'm been running into this problem several times. Say I have a modal GUI window, and if there is something wrong with its close request function, it will give an error message when I try to close it instead of closing, and I can't go back to the command window. Ctrl+C doesn't work either, so I always ends up killing matlab from task manager. Is there a way to break from a modal GUI window?
Thanks!
Niko

채택된 답변

Orion
Orion 2014년 10월 29일
Hi,
one way to manage the closure of a modal figure is to encapsulate your closerequestfcn in a try-catch statement, otherwise I think you'll be forced to kill matlab.
something like :
function YourCloseRequestFcn(...)
try
% your original code which might crash while the developpement stage
catch
closereq; % make sure you close the window.
end

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Environment and Settings에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by