Problem with listbox in Matlab GUI.
Mostrar comentarios más antiguos
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
I have 2 listbox. First listbox is show X coordinates and second one show the correspondind Y values for each X. eg. When I press X = 100 on the second listbox I see e.g Y = 100,101,102 ect. Sometimes when I press some values on Y listbox, and after that I change value on X listbox the Y listbox disappear and the error above shows.
Picture shows how it should work

Picture shows how it work when I press value higher than 100 on Y then when I press 442 X the Y listbox disappear.

I didn'y show the code because it's a lot of code and I think it's something wrong with listbox by itself. This is working properly. When I press 442 X it's working well but the error happens under specific conditions.
Any idea what might go wrong ?
Respuesta aceptada
Más respuestas (3)
Jan
el 27 de Sept. de 2013
The warning message is clear: The values of the 'Min' and 'Max' properties define the listbox as a single selection control. Then exactly one element must be selected. If you want to select no or multiple elements, the distance between 'Min' and 'Max' must be greater than 1. Exmaple:
h = uicontrol('Style', 'listbox', 'String', {'1', '2'}); % Ok
pause(1);
set(h, 'Value', []); % Nothing selected, warning appears
pause(1)
set(h, 'Max', 2); % Listbox appears again
2 comentarios
Jonasz
el 28 de Sept. de 2013
Jan
el 28 de Sept. de 2013
@Jonasz: Ok, but because you did not show us the corresponding code at first, this guess would at least result in the same error message. The more details you post to describe a problem, the less time is wasted with wrong guesses.
Jonasz
el 28 de Sept. de 2013
Jonasz
el 28 de Sept. de 2013
0 votos
Categorías
Más información sobre Language Support en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!


