Filter löschen
Filter löschen

Error in popupmenu and push button

3 Ansichten (letzte 30 Tage)
Gee Cheng Mun
Gee Cheng Mun am 14 Jan. 2016
Beantwortet: Walter Roberson am 14 Jan. 2016
Warning: popupmenu control requires a scalar Value
Control will not be rendered until all of its parameter values are valid
> In openfigLegacy at 120
In gui_mainfcn>local_openfig at 286
In gui_mainfcn at 158
In Finaldraft at 42
  1 Kommentar
Joseph Cheng
Joseph Cheng am 14 Jan. 2016
could you post the snippit of code that generates the popupmenu and what you're trying to populate the popupmenu with? Without knowing how you're attempting to do this and what you're putting in the menu the warning is probably sufficient to explain what you're doing wrong + debugging tool.

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 14 Jan. 2016
Somehow you have a uicontrol('style','popup') whose Value property is either [] or not a scalar. This would not be the default for such a control (the default is 1), and is not caused by there being an empty String property (you get a different warning for that.) Your code must be changing the Value property itself.
Note that the Value property for a uicontrol of style popup or listbox is which entry (popup) or entries (listbox) is selected, as indices into the cell string. Sometimes people use popups or listbox with strings that happen to look like numbers and then they try to use a Value property which is the numeric value of the string they want to be selected; this is wrong. Sometimes people use a Value which is the string they want selected; this is wrong too. The Value needs to be the numeric index (popup) or vector of indices (listbox) regardless of what the strings happen to look like.
Another potential issue is that if you have a uicontrol('style', 'listbox') and you set its style to be popup then if the Value property was before a vector of values (because in general listboxes can have multiple items selected) then you need to change the Value property to just a single index (because popup cannot have multiple items selected.)

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by