Using a main GUI window to open new ones
이전 댓글 표시
I wrote a .fig file's name into button's callback funtion. When I click a button, a new GUI is opening and it's being 2 windows , when I click another button, another GUI is opening , and it's being 3 windows on the screen. But I don't want multiple windows on the screen. I want to use one main window and open my GUIs' on that main window. How can I do that.(By the way I'm creating my GUIs'with GUIDE not with code)
Thanks in advance.
답변 (2개)
Geoff Hayes
2014년 12월 21일
Mahbube - if you are launching a second GUI from the first, via a pushbutton callback in the first GUI, then just close the first one. Try something like
function pushbutton1_Callback(hObject, eventdata, handles)
% launch your other GUI
% close the current GUI
close(handles.figure1);
The above assumes that the figure object of the first GUI is named/tagged as figure1. You can also close it by using/calling the name of the GUI, but the other way makes it clear exactly which figure/GUI that you are closing.
Try the above and see what happens!
댓글 수: 2
Mahbube
2014년 12월 21일
Geoff Hayes
2014년 12월 22일
What was the style that you were looking for?
Joseph Cheng
2014년 12월 22일
편집: Joseph Cheng
2014년 12월 22일
0 개 추천
What you could do is work with panels. i attached an example. I didn't have much time to comment it fully but it boils down to creating your different GUIs in panels and then shuffling them around depending on the button pressed.
- During opening function record position of all the panels
- save which one is the active panel
- limit the view to just the panel
- depending on which button was pressed swap the positions of the active panel with the desired.
카테고리
도움말 센터 및 File Exchange에서 App Building에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!