How to reset popupmenu in GUI
1 次查看(过去 30 天)
显示 更早的评论
Hie guys, can i know how to reset popupmenu to the string that we give it a name?
regards, Ean
回答(2 个)
Jan
2011-3-19
It is still not getting clear to me. You have a popupmenu. What is "give it a string name"? and what does "clear it all" mean? Do you want to set the 'String' or the 'Value' property?
popH = uicontrol('Style', 'popupmenu', ...
'String', {'1', '2', '3'});
pause(1);
set(popH, 'Value', 2);
pause(1);
set(popH, 'Value', 1, 'String', {'new'});
pause(1);
Does this help??
0 个评论
Walter Roberson
2011-3-19
What you want to do is not possible, as it is not possible to give a popup menu a name at all. You can assign the handle of the popup menu to a variable, and you can assign a Tag to the popup menu, and you can change the contents of the pop-up menu by changing its String property -- but you cannot give it a name.
1 个评论
Oleg Komarov
2011-3-19
Well, you can always call it Betsy or Jimmy, but that would remain within the depths of your heart :).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Migrate GUIDE Apps 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!