restart GUI with code

조회 수: 10 (최근 30일)
Matthias
Matthias 2012년 2월 2일
Hello!
I am writing a GUI programmatically (not with GUIDE). Is it possible to close and re-open the GUI with a pushbutton callback within that very GUI? If so, how do I code it? I have been looking everywhere, I cannot find anything.
Thanks so much for any help!

채택된 답변

Jan
Jan 2012년 2월 2일
If the GUI creator function is called OpenGUI:
function PushButtonCallback(ObjH, EventData)
OrigDlgH = ancestor(ObjH, 'figure');
delete(OrigDlgH);
OpenGUI;
end
So simply close the existing dialog and create a new one. Or do it the other way around.
  댓글 수: 2
Matthias
Matthias 2012년 2월 2일
Perfect! Thank you very much, Jan!
Dani Tormo
Dani Tormo 2012년 12월 17일
That works, but how to get the original uicontrol settings?
I am using GUIDE and I set some settings before start: some texts hiden, buttons and edits disabled; the data of edits to a certain value; axes without data, etc.
Do I have to do it manually in OpenGUI?

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by