Creating Graphical User Interfaces Previous page   Next Page

Button Groups

Button groups are like panels, but can be used to manage exclusive selection behavior for radio buttons and toggle buttons. The button group's SelectionChangeFcn callback is called whenever a selection is made.

For radio buttons and toggle buttons that are managed by a button group, you must include the code to control them in the button group's SelectionChangeFcn callback function, not in the individual uicontrol Callback functions. A button group overwrites the Callback properties of radio buttons and toggle buttons that it manages.

This example of a SelectionChangeFcn callback uses the Tag property of the selected object to choose the appropriate code to execute.


Previous page  Panels Axes Next page

© 1994-2005 The MathWorks, Inc.