uibuttongroup with no buttons selected?
11 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I would like to have a uibuttongroup that contains several togglebutton objects. By default, the uibuttongroup obviously only lets you have one toggle button selected (i.e., pressed) at a time. But I would like the possibility to have none of the buttons pressed. I don't see an obvious way to do that using a uibuttongroup. I fear I'll have to just create the toggle buttons and write the logic that controls the states of the buttons myself.
For example, look at the way the default toolbar works in a matlab figure. There are several buttons (rotate, data cursor, etc), and you can't have more than one pressed at a single time, but you can have none of them selected. Any ideas would be much appreciated!
Thanks, Justin
4 comentarios
Adam
el 29 de Abr. de 2016
You can't deselect a radio button though, it isn't like a toggle button so you could never get back into the nothing selected state even if you could initialise that way.
Respuestas (1)
Walter Roberson
el 29 de Abr. de 2016
Create one additional button and set its visible property off, and make it the initially selected button.
2 comentarios
Walter Roberson
el 30 de Abr. de 2016
You could make that extra button visible and label it as "None" or something similar.
uibuttongroup can also manage toggle buttons; you might want to experiment with that.
Ver también
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!