Thread Subject: Help me to do panel disappearing with GUIDE

Subject: Help me to do panel disappearing with GUIDE

From: Naveenarjuna

Date: 21 Mar, 2010 21:10:05

Message: 1 of 2

Hi,

    i want to create two panels, If i select one option through popup menu i want to display one panel...If i select another option in popup menu i want display another panel..
I am trying like below code

switch get(handles.popupmenu,'value')
    case 1
        set(handles.uipanel1,'visible','on');
        set(handles.uipanel2,'visible','off');
    case 2
        set(handles.uipanel1,'visible','off');
        set(handles.uipanel2,'visible','on');
end

Am not getting....
Please give me suggestions

Subject: Help me to do panel disappearing with GUIDE

From: Walter Roberson

Date: 21 Mar, 2010 21:20:38

Message: 2 of 2

Naveenarjuna wrote:

> i want to create two panels, If i select one option through popup
> menu i want to display one panel...If i select another option in popup
> menu i want display another panel..
> I am trying like below code
>
> switch get(handles.popupmenu,'value')
> case 1
> set(handles.uipanel1,'visible','on');
> set(handles.uipanel2,'visible','off');
> case 2
> set(handles.uipanel1,'visible','off');
> set(handles.uipanel2,'visible','on');
> end
>
> Am not getting....

I do not see anything obviously wrong with that. What are you seeing
when you use this code?


The one thing I might suggest is that since this is probably in the
callback for the popupmenu, that you should replace handles.popupmenu by
src, as in

switch get(src, 'value')

In a callback, src always refers to the current control whose callback
is being invoked.

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

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.

rssFeed for this Thread

Contact us at files@mathworks.com