EXECUTING POPUP MENU SELECTION ON PUSH BUTTON PRESS

조회 수: 1 (최근 30일)
saqib anwaar
saqib anwaar 2017년 2월 28일
답변: Jan 2017년 2월 28일
i have a list of modes in popup menu. i want to select a mode from there. then there should be a push button, on pressing this button, the selected mode should execute. i.e. only the selection will be made in popup menu, the execution of that selection would be by a push button. how should i code this?
  댓글 수: 1
Adam
Adam 2017년 2월 28일
Just access the popup menu via its handle in the push button callback. There are numerous examples in the documentation for GUI creation.

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

답변 (1개)

Jan
Jan 2017년 2월 28일
Do you want to create the GUI programmatically or using GUIDE? Both have advantages and disadvantages.
For the first you can find valuable examples in FEX: 41 GUI examples.
Create the popup menu and store its handle e.g. in the handles struct - see: doc guidata. In the callback of the push button, obtain the handle of the popup menu, then get the current selection and use it to start the calculations.
I suggest to try it and post the code here in case of problems. If you ask specific questions then, a concrete help is possible.

카테고리

Help CenterFile Exchange에서 Simulink Environment Customization에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by