Reputation: 3289
can somebody please tell me why my pop-up menu list get disappear when I set a string which actually belongs to one of the item in the list? I want this string to be appear as default when GUI gets open, however, want other items to be in the pop-up menu.
For example, pop-up list contains:
Set_1
Set_2
Set_3
Set_4 etc..
And, in the function OpeningFcn, I am settting:
set(handles.popupmenu1, 'String', 'Set_1');
This makes 'Set_1' to appear when I open GUI. However, it makes other items (Set_2, Set_3 etc) disappear from the GUI. Thanks.
Upvotes: 0
Views: 1581
Reputation: 24127
The String
property of a popupmenu uicontrol sets the entire text that is displayed in the menu.
To select a particular option, set the Value
property to the index of the item to be selected. In this case, since Set_1
is the first item, set the Value
property to 1.
Upvotes: 2