Why do I encounter "Warning: popupmenu control requires a scalar Value" in openfig.m when I try to start my GUI?
16 次查看(过去 30 天)
显示 更早的评论
When I start my GUI while in debugging mode "Stop on Warnings" (by typing the gui name "dashboard" in the command line), I receive the following message:
>> dashboard
Warning: popupmenu control requires a scalar Value Control will not be rendered until all of its parameter values are valid
> In openfig at 135
In gui_mainfcn>local_openfig at 286
In gui_mainfcn at 234
In dashboard at 49
Warning from openfig at 135
figure(fig(i));
This message is generally repeated several times (5 times in this case), which doesn't correlate to the number of popup menus in my GUI (15). The GUI then proceeds to display and seems to work just fine.
When I looked in openfig as well as in gui_mainfcn, and dashboard, I didn't see any mention of a popup menu. When I checked the popup menus in my GUI .fig file using GUIDE, all of them had scalar values (1.0) specified.
Googling the warning message yielded no useful threads. I found one person who seemed to have a similar problem, but there was no suggested answer (<http://www.mathworks.com/matlabcentral/newsreader/view_thread/28242)>.
I'm using 2012b on a 64-bit system running Windows 7 Professional.
Can anyone explain this behavior to me? My GUI is very large and was written by someone else. I'm trying to fix some bugs, and was wondering if they may partially be related to this message.
Thanks!
0 个评论
回答(2 个)
Walter Roberson
2013-10-25
At the command prompt, give the command
dbstop if warning
and then open the figure. It should stop at the point where it attempts to set() a uicontrol's Value to a vector.
If there happens to be only one popupmenu then you could search the source code more directly.
0 个评论
Vishal Rane
2013-10-28
编辑:Vishal Rane
2013-10-28
The 'Value' property determines which of the elements in a cell array ('String' property of the popupmenu) will be displayed by default. Hence its value must be a scalar between 1 and numel(your_cell_array). Unless you give it a default value, it will keep giving you this warning. Also the popupmenu itself wil not appear on the default GUI, though it does appear if you set any of its properties later.
0 个评论
另请参阅
类别
在 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!