How to open one GUI from Another using a Pop-up menu

1 次查看(过去 30 天)
So I have a main GUI that I want to open up sub-GUIs.
On the main GUI I have 2 push buttons (Car and Boat) next to each other. Beneath them I have a Pop-up menu (one for each push button).
What I desire is once the user selects either the Car or Boat push buttons the relative Pop-up menu will activate with the different sub-GUIs (and their file paths).
The sub-GUI list will be the type of Car or Boat, which once selected the sub-GUI will open and the user has to put in the different data for depreciation, insurance costings etc.
I don't want to have to "poll" each sub-GUI if at all possible.

采纳的回答

Image Analyst
Image Analyst 2016-3-5
Why do you want the second GUI name in a popup menu if you want to active it immediately upon pushing the button? Anyway, you simple set the popup index in the callbacks. Let's say the string property for the popup was set in GUIDE with the strings 'CarGUI.m' and 'BoatGUI.m'. So then in the car button callback
% Set popup to index 1
set(handles.popup, 'Value', 1);
% Now launch the CarGUI function
CarGUI
And in the callback for the boat, you'd do
% Set popup to index 2
set(handles.popup, 'Value', 2);
% Now launch the BoatGUI function
BoatGUI
  5 个评论
Image Analyst
Image Analyst 2016-3-6
The commands inside the "if" blocks will run the subGuis. If you don't expect any results to be returned and simply want to launch an m-file called "FordMustang.m", then simply have
FordMustang
That will launch FordMustang.m and it should appear as the top most window. If you want it maximized in the Windows OS, in FordMustang's startup code, call MaximizeFigureWindow - Yair's function which I attach.

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Genomics and Next Generation Sequencing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by