필터 지우기
필터 지우기

Error in popupmenu and push button

조회 수: 3 (최근 30일)
Gee Cheng Mun
Gee Cheng Mun 2016년 1월 14일
답변: Walter Roberson 2016년 1월 14일
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
Joseph Cheng
Joseph Cheng 2016년 1월 14일
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.

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 1월 14일
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.)

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by