How to get Second GUI to pop up in Front of Main GUI instead of Behind

조회 수: 9 (최근 30일)
Michael Johnson
Michael Johnson 2015년 3월 28일
답변: Geoff Hayes 2015년 3월 28일
When i launch another GUI from my main GUI, the new one pops up BEHIND the main GUI, i want it to pop up in front of the main GUI. is there a "make this the current figure" code? or a "send GUI to back" code?

답변 (2개)

Michael Johnson
Michael Johnson 2015년 3월 28일
so... in order pass data from mainGUI to secondGUI i used setappdata(mainGUI,'',) then launched the secondGUI. The figure window of secondGUI popped up behind the mainGUI though.
I changed this to setappdata(0,'',) and the secondGUI now pops up IN FRONT of the mainGUI.
So what are the cons of setting app data in the root?
after the GUIs are closed, should i clean up what was stored there?
Is setting app data in the figure or the root preferable?

Geoff Hayes
Geoff Hayes 2015년 3월 28일
Michael - if you want to have your second GUI appear in front of the first one, you can use uistack to re-order the visual stacking order of objects. In the function where you launch your second GUI, just do the following (assuming you launch the GUI by calling its name)
hGui = MyGui;
uistack(hGui,'top');

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by