Why does UIWAIT throw a warning message when used with Popup menu?

UIWAIT does not seem to properly handle popup menus that are defined using the “|” separator.
The following code is used to declare strings in a popup menu:
v = 'Menu Item 1|Menu Item 2';
set(handles.ActiveSelector, 'String', v);
The following warning is obtained when UIWAIT is used with the above popup menu (that is defined using the “|” separator):
Warning: popupmenu control requires that Value be an integer within String range
Control will not be rendered until all of its parameter values are valid.
In uiwait at 54
In untitled>untitled_OpeningFcn at 64
In gui_mainfcn at 166
In untitled at 42

 採用された回答

MathWorks Support Team
MathWorks Support Team 2009 年 6 月 27 日

0 投票

There is a bug in MATLAB 7.0.4 (R14SP2) in the way the popup menu string is parsed prior to rendering this UI control in a Java figure.
To work around this issue, use cell arrays to declare strings in the popup menus.
Declare the strings for the popup menu using the following syntax
v = {'Menu Item 1','Menu Item 2'};
which does not result in an error.

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeApp Building についてさらに検索

製品

リリース

R14SP2

Community Treasure Hunt

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

Start Hunting!

Translated by