ButtonGroup for HG2

Container object to manage radio or toggle buttons with the GUI Layout Toolbox - for 2014b onwards


Updated Fri, 11 Sep 2015 13:47:05 +0000

View License

The ButtonGroup controls require the GUI Layout Toolbox by Ben Tordoff and David
Sampson available at:
The controls in this submissionshould be placed in the +uix folder in the GUI Layout Toolbox or in another folder called +uix that resides under a folder on your path.
gFig = figure();
gVButtonsBox = uix.VButtonGroup('Parent',gFig, 'Spacing',10,...
'ButtonSize', [200 40], 'ButtonStyle','radio',...
'HorizontalAlignment','left', 'VerticalAlignment','middle');
gVButtonsBox.Buttons = {'Button 1','Button 2', 'Button 3'};
gVButtonsBox.SelectionChangeFcn = {@(gSource,eventdata) disp(gSource.SelectedObject.String)};

Cite As

Clym Stock-Williams (2023). ButtonGroup for HG2 (https://www.mathworks.com/matlabcentral/fileexchange/52965-buttongroup-for-hg2), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2014b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: GUI Layout Toolbox

Community Treasure Hunt

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

Start Hunting!
Version Published Release Notes

Fixed issue with buttons turning off with multiple presses

Slight tidy ups. NB. Any suggestions on how to improve it very welcome