Gui pop up menu selection

Hello,
I am associating a panel with four radio buttons with a pop up menu. Using the radio buttons to select different menu that could occur on the pop up menu. I have the menu choices stored in a string:
set(handles.ctqMenu, 'String', ctqString);
the index of each menu that could possible be selected is different. Once the specific menu is chosen how to I go about storing which index of that menu the user has chosen. For example if the menu options weree:
ctqString = {'Option0'; 'Option1'; 'Option 2'; 'Option3'};
So in a nutshellI am selecting a specific menu via radio buttons and now need to create a way to store which option the user chose of that selected menu.
Thank you

 Réponse acceptée

Fangjun Jiang
Fangjun Jiang le 29 Juin 2011

1 vote

In your radio button (actually the button group since you must have 4 exclusive radio buttons) SelectionChangeFcn callback function:
Tag=get(hObject,'Tag')
switch Tag
case 'radiobutton1'
ctqString= {'Option0'; 'Option1'; 'Option 2'; 'Option3'};
case 'radiobutton2'
ctqString= {'Option10'; 'Option11'; 'Option 12'};
end
set(handles.ctqMenu,'String',ctqString);

Plus de réponses (0)

Catégories

En savoir plus sur App Building dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by