Gui pop up menu selection

1 次查看(过去 30 天)
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

采纳的回答

Fangjun Jiang
Fangjun Jiang 2011-6-29
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);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by