User`s guide
Working with Callbacks in GUIDE
of that component. For example, a push button has five callback properties:
ButtonDownFcn, Callback, CreateFcn, DeleteFcn,andKeyPressFcn.A
panel has four callback properties:
ButtonDownFcn, CreateFcn, Dele teFc n,
and
ResizeFcn. Y ou can—but do not have to—create a callback function for
each of these properties, including callbacks for the GUI figure itself.
Each callback has a triggering mechanism or event that causes it to execute.
The following table lists the callback properties that are available, their
triggering events, and the components to which they apply.
Callback Property Triggering Event Components
ButtonDownFcn
Executes when the GUI
user presses a mouse
button while the pointer is
on or within five pixels of a
component or figure.
Axes, figure,
button group,
panel, user
interface controls
Callback
Control action. Executes,
for example, when a GUI
userclicksapushbuttonor
selects a menu item.
Context menu,
menu user
interface controls
CellEditCallback
Reports any edit made to
avalueinatablewith
editable cells; uses event
data.
uitable
CellSelectionCallback
Reports indices of cells
selected by mouse gesture
in a table; uses event data.
uitable
ClickedCallback
Control action. Executes
when the push tool or
toggle tool is clicked.
For the toggle tool,
executing the callback
is state-independent.
Push tool, toggle
tool
CloseRequestFcn
Executes when the figure
closes.
Figure
8-3