Using a main GUI window to open new ones
Afficher commentaires plus anciens
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.
Réponses (2)
Geoff Hayes
le 21 Déc 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 commentaires
Mahbube
le 21 Déc 2014
Geoff Hayes
le 22 Déc 2014
What was the style that you were looking for?
Joseph Cheng
le 22 Déc 2014
Modifié(e) : Joseph Cheng
le 22 Déc 2014
0 votes
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.
Catégories
En savoir plus sur MATLAB dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!