Warning for uicontrol's ListboxTop value; listBox does not appear
2 ビュー (過去 30 日間)
古いコメントを表示
Hallo everyone, this is my problem. i have a gui code that creates this .fig. The thing is that there sould be a listbox at the top left side of the window, next to the second one. At the command window there is a warning that says "Warning: This uicontrol's ListboxTop value (191) must be within the String range (1:57) Control will not be rendered until all of its parameter values are valid "
The thing is, that I have this problem only when using matlab2016a. In matlab2011a, there was no such a problem. Any ideas how to fix it?
thank you a lot.
0 件のコメント
回答 (1 件)
PG_Dev
2017 年 11 月 22 日
編集済み: PG_Dev
2017 年 11 月 24 日
Rania,
Good question.
Your current listbox in the GUI seems to have at-least 191 values but the second one has a max range of 57. Matlab GUI looks for the default value(or entry) which will be selected in the listbox before it creates it. You might have selected the 191st entry in the first listbox and that value could be taken by Matlab as the default selection value when it attempts to create it but you have populated the second listbox with only 57 values.
To workaround this issue, immediately after intializing (or re-intializing after you re-populate) any listbox (or also a pop-up/drop-down menu for that matter) use the following statement to reset the default selection to the first value.
set(Your_Listbox_Handle, 'Value', 1);
Let me know if it worked.
Regards
PG
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Interactive Control and Callbacks についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!