필터 지우기
필터 지우기

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

조회 수: 1 (최근 30일)
Jay
Jay 2016년 3월 5일
댓글: Jay 2016년 3월 11일
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.
Jay
Jay 2016년 3월 11일
Thanks Image Analyst.
It works.

댓글을 달려면 로그인하십시오.

추가 답변 (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