How can I enable a pop-up menu, by clicking a pushbutton in guide?

I have two different pop-up menus for two different pushbutton events.
I need only one of those two pop up menus to be in the guide when its corresponding pushbutton is pressed.
To be in more detail, I have only one place which should be completely occupied by either only one pop up menu(after event occurred) or two pushbuttons (before event occurs). There are two pushbuttons, e.g. 1.Animals 2.Birds
If I click on 'Animals' pushbutton, then a pop-menu having a list of animal names should be displayed in the place where the pushbuttons are located.
And if I click on 'Birds' pushbutton, then a pop-up menu having a list of bird names should be displayed in the same place.
How can I do this? Help me.

 채택된 답변

Vishal Rane
Vishal Rane 2012년 12월 11일

0 개 추천

In the pushbutton callbacks for both buttons, set the list for the popupmenu with respective data i.e. either animals or birds list.
So now you have two different buttons populating different data into the same list.

댓글 수: 4

Vishal Rane
Vishal Rane 2012년 12월 11일
편집: Vishal Rane 2012년 12월 11일
Oops read only a part of your question.
You can initially set buttons to visible and list to invisible. Then on either button click reverse the visibility status for buttons and the list.
Mr.Vishal Can you please give me an example, like how to set the list.
In the pushbutton callbacks set popupmenu list as:
set(handles.popmenutag,'String',AnimalOrBirdList)
To toggle visibility use:
set(handles.componenttag,'Visible','on|off')
Thank you, Mr.Vishal

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

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Animation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by