Using MATLAB GUI popup

조회 수: 7 (최근 30일)
Muhammad Jibran
Muhammad Jibran 2019년 7월 16일
댓글: Adam Danz 2019년 7월 19일
I’m working on a GUI , I have use a popup menu which gets enabled on/off by clicking on a check box. As I click on the check box the popup menu enables On , I select an option from popup menu. After some time when i again click on checkbox to make the popup menu disabled. The selected string on the popup menu is retained, although the popup menu is not enabled now. Moreover, if I again enable the popup box it will have the same string retained. Kindly guide me how the popup menu will come to its default string on it’s deactivation .
  댓글 수: 1
Adam Danz
Adam Danz 2019년 7월 19일
@ Muhammad Jibran, please take a moment to review the answers provided to you by volunteers and accept any answers that led you to a solution. This way they are marked as 'answered' and when others have similar questions and see you post, they know the solution worked.

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

답변 (1개)

Adam Danz
Adam Danz 2019년 7월 16일
편집: Adam Danz 2019년 7월 18일
Presumably you have a callback function for the checkbox that controls the "enabled" property of the popup menu. Within that callback function, when the popup menu is turned off, also reset its selection to a default value. Note that the "Value" must be a scalar or it won't be rendered.
set(handles.mypopupmenu,'Value', 1) %default value

카테고리

Help CenterFile Exchange에서 Startup and Shutdown에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by