Using a main GUI window to open new ones
11 views (last 30 days)
Show older comments
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.
0 Comments
Answers (2)
Geoff Hayes
on 21 Dec 2014
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 Comments
Joseph Cheng
on 22 Dec 2014
Edited: Joseph Cheng
on 22 Dec 2014
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.
0 Comments
See Also
Categories
Find more on Migrate GUIDE Apps in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!