Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
Allowing Pushbutton to talk to Popupmenu

Subject: Allowing Pushbutton to talk to Popupmenu

From: Kirsten

Date: 20 Aug, 2010 16:37:05

Message: 1 of 3

I'm fairly new to the GUI side of MATLAB and I'm looking for a way to have multiple Popupmenus talk to each other.

Here's the current scenario:

1) User selects the appropriate case from the first popupmenu.
2) User selects the "Go" button (pushbutton)
3) The second popupmenu autopopulates with new data based on what was selected in the first popupmenu.

I have the logic within each step, but I'm not sure how to get MATLAB to talk between steps 2 and 3.
Thanks!

Subject: Allowing Pushbutton to talk to Popupmenu

From: Sean

Date: 20 Aug, 2010 16:50:04

Message: 2 of 3

"Kirsten " <kirsten.swanson@swe.org> wrote in message <i4mavh$oa4$1@fred.mathworks.com>...
> I'm fairly new to the GUI side of MATLAB and I'm looking for a way to have multiple Popupmenus talk to each other.
>
> Here's the current scenario:
>
> 1) User selects the appropriate case from the first popupmenu.
> 2) User selects the "Go" button (pushbutton)
> 3) The second popupmenu autopopulates with new data based on what was selected in the first popupmenu.
>
> I have the logic within each step, but I'm not sure how to get MATLAB to talk between steps 2 and 3.
> Thanks!

%Tools
help getappdata
help setappdata

%Methodology
Set the handles of your second GUI and the various stuff in it to appdata. It can then be modified by your pushbutton.

Subject: Allowing Pushbutton to talk to Popupmenu

From: ashutosh srivastava

Date: 20 Aug, 2010 16:57:06

Message: 3 of 3

"Kirsten " <kirsten.swanson@swe.org> wrote in message <i4mavh$oa4$1@fred.mathworks.com>...
> I'm fairly new to the GUI side of MATLAB and I'm looking for a way to have multiple Popupmenus talk to each other.
>
> Here's the current scenario:
>
> 1) User selects the appropriate case from the first popupmenu.
> 2) User selects the "Go" button (pushbutton)
> 3) The second popupmenu autopopulates with new data based on what was selected in the first popupmenu.
>
> I have the logic within each step, but I'm not sure how to get MATLAB to talk between steps 2 and 3.
> Thanks!

dear kirsten,
u may do it this way.
1. the contents of first popupmenu have already ben selected. ( u indicated).
2. store them in a global variable.
3. when the pushbutton is pressed, i.e. its callback is executed, call this global variable therein and pass on its contents to "string" field of the other popupmenu. but do remember to adjust the 'Max / Min' field accordingly.
4. hence when this popupmenu is used, its contents have already been populated.

i do hope this may help u somehow.

Tags for this Thread

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us