Resetting a pop-up menu in a GUI

3 visualizaciones (últimos 30 días)
C Meek
C Meek el 1 de Dic. de 2011
Hey all,
In my GUI I have a drop down menu with four options, the first (& default) option being 512. I also have a reset button, which sets everything else in the GUI back to its default options.
My problem is I'm not sure how to set a drop down menu back to its default option, in this case being the first entry in the list.
My drop down menu is tagged frame_size_2. I know the code, placed in the callback for the reset button, is something along these lines:
set(handles.frame_size_2,'Value')
But I can't work out what is supposed to go in the 'Value' part.
Any tips?
As always, thanks in advance for any help.

Respuesta aceptada

Sean de Wolski
Sean de Wolski el 1 de Dic. de 2011
set(handles.frame_size_2,'Value',n)
where n is the index to the line you want. And a good tip for remembering, set has three inputs, get has two.
  1 comentario
C Meek
C Meek el 1 de Dic. de 2011
Literally worked this out just before you posted. Thanks all the same - your tip about the number of inputs for set and get will be useful as I often forget!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Interactive Control and Callbacks en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by