From: jens on 24 Apr 2010 15:10 Hi Matlab users I have a GUI with a listbox and some checkbuttons. I used the checkbuttons to update the strings in the listbox. When I do not have marked the first string in the listbox and try to update the listbox I get the error: Warning: single-selection listbox control requires that Value be an integer within String range Control will not be rendered until all of its parameter values are valid My code is something like: r={'Test1' 'Test2' 'Test3''} %the contents of the cellarray r depends on what checkbuttons there are checked (value=1). set(hlb,'string',r) %hlb is the handle to the listbox Should I maybe reset the string in the listbox before I update it with new strings? Best Regards Jens
From: Walter Roberson on 24 Apr 2010 16:34 jens wrote: > When I do not have > marked the first string in the listbox and try to update the listbox I > get the error: > > Warning: single-selection listbox control requires that > Value be an integer within String range > Control will not be rendered until all of its parameter > values are valid > My code is something like: > > r={'Test1' 'Test2' 'Test3''} %the contents of the cellarray r depends on > what checkbuttons there are checked (value=1). > > set(hlb,'string',r) %hlb is the handle to the listbox You have an old Value for the handle that is outside the range 1:length(r). Easiest work around: set(hlb, 'string', r, 'Value', 1);
From: Matt Fig on 24 Apr 2010 16:35 You may need to explicitly set the 'value' property of the listbox to 1 every time before you change it's string. That usually takes care of this error. set(hlib,'value',1,'string',r)
|
Pages: 1 Prev: Ordered computation of eigenvalues from good initial estimates, Next: QAM simulink model HELP |