User`s guide

WriteCodeforCallbacks
GUI Component
Callbacks with Event
Data
Property Reference
Pages
Figure
KeyPressFcn,
KeyReleaseFcn,
WindowKeyPressFcn,
WindowKeyReleaseFcn,
WindowScrollWheel
Figure Properties
User interface
control
(
uicontrol)
KeyPressFcn
Uicontrol Properties
Button group
(
uibuttongroup)
SelectionChangeFcn
Uibuttongroup Properties
Table (uitab le)
CellEditCallback,
CellSelectionCallback
Uitable Properties
Share Callbacks Among Components
If you are designing a GUI and programming it yourself (outside of GUIDE),
you can attach the sam e callback to more than one component. This is a
good technique to use when a group of controls perform similar actions with
small variations or operate identically on different data. In such cases, you
can design a single callback function that provides separate code paths to
handle each case. The callback can decide what code path to take based on
the identity and type of object that calls it, or on the basis of parameters
passed into it.
For an example of a callback shared by three check boxes that plot three
different columns of tabular data, see “GUI that Displays and Graphs
Tabular Data” on page 15-19. All three components do the same thing; the
last argument in their common callback provides the number of the column
to retrieve data from when plotting.
12-19