Open a gui in a gui
2 views (last 30 days)
Show older comments
Dear all, Thank you in advice to help me. I want to create a GUI in a GUI. Let me explain. I already developped all the GUI and pressing the pushbutton of the “main” GUI I can open all the others (depending on what button I am pushing) as a “pop up”. My question is that: is it possible to have a fixed “main” GUI and open the other GUIs (pushing the button) as part of the main GUI? It is like to create a list on the left part of the GUI and the right part is used to show the sub-GUI when pressing the button. i was thinking to set the new GUI inside a panel in the main GUI, nut i cannot handle the problem Please help me
Thank you all!!!
1 Comment
Adam
on 2 Aug 2016
I haven't used the new App Designer yet so I can't speak for what functionality it has, but docking GUIs inside other GUIs is not something that can easily be done from e.g. a GUIDE GUI. The GUI Layout toolbox on file exchange provides some extra functionalities, but really you are still looking at putting what would be in the new GUI into a panel rather than a figure. In that case then it is certainly possible, though depending on what behaviour you want from the GUI as a whole you may have to do a lot of manual resizing of other components.
Answers (1)
Nick
on 2 Aug 2016
So I assume you are familiar with MATLAB's GUIDE function.
Generally, to have another GUI popup, you have to create 2 .fig gui's with the guide function and call one GUI within the other.
For example, I had a checkbox button in GUI_1 where if if the button is checked, then a new GUI pops up. If its unchecked, close the GUI.
% --- Executes on button press in New_GUI_Popup.
function New_GUI_Popup_Callback(hObject, eventdata, handles)
if get(hObject, 'value')
GUI_2
else
try
close GUI_2
catch
end
end
Also, try to keep both of these .fig and .m files within the same folder.
The "try, catch" statement is there in case somebody manually closes the GUI using the "X" mark on the window instead of closing it from the GUI. You'll find out all sorts of weird handle logic that can be introduced by the user with multiple GUI's.
1 Comment
Nick
on 2 Aug 2016
Actually, after reading your question again. It seems that I misunderstood it. I agree with a previous commentor, nesting GUI functions within each other is not straightforward.
You can try experimenting with using a uipanel as part of a GUI. Though I havent tested this myself so I cant say if it will work.
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!