Question

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.

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top