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

 採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 6 月 29 日

1 投票

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 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by