Why do I encounter "Warning: popupmenu control requires a scalar Value" in openfig.m when I try to start my GUI?

4 views (last 30 days)
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!

Answers (2)

Walter Roberson
Walter Roberson on 25 Oct 2013
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.

Vishal Rane
Vishal Rane on 28 Oct 2013
Edited: Vishal Rane on 28 Oct 2013
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.

Categories

Find more on App Building in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!