|
"John " <jrazzano@usc.edu> wrote in message <ichhig$kmd$1@fred.mathworks.com>...
> "Brianne " <brianne.y.williams@aero.org> wrote in message <ichfvs$9du$1@fred.mathworks.com>...
> > I want to create a menu bar on my GUI figure, that says option 1 and option 2.
> > I then want the user to be able to click either option and the respected GUI displays on the figure. For example, if the user clicks option 1 then some editable boxes appears on the figure. If the user clicks option 2 then a editable table appears on the figure.
> >
> > My question is how to I get the figure to clear if the user clicks option 1, first, then clicks options 2, second, and vice versa without losing the menu bar when the figure is cleared.
>
> When the first option is selected I would have a callback routine that sets the 'Visible' property of all the elements pertaining to the second option to 'off' and vice versa, hope that helps.
>
> John
John is right, here's a simple example:
- One simple GUI with two pushbuttons, OPTION1 and OPTION2
- One editbox (edit1) and one axe (axes1)
- Start with only the pushbuttons visible by adding this to the GUI initialization code
set(handles.edit1,'Visible','off');
set(handles.axes1,'Visible','off');
- The callback for the pushbutton OPTION 1 puts the editbox visible and the axes1 invisible
set(handles.edit1,'Visible','on');
set(handles.axes1,'Visible','off');
- The callback for the pushbutton OPTION 2 puts the editbox invisible and the axes1 visible
set(handles.edit1,'Visible','off');
set(handles.axes1,'Visible','on');
hope this helps
|