User`s guide

Default Callback Properties in GUIDE
Default Callback Properties in GUIDE
In this section...
“Setting Callback Properties Automatically” on page 8-11
“Deleting Callbacks from a GUI Code File” o n page 8-14
Setting Callback Properties Automatically
A GUI can have many components. GUIDE provides a way of specifying which
callback runs in response to a particular event for a particular component.
The callback that runs when the GUI user clicks a Yes button is not the one
that runs for the No button. Similarly, each menu item usually performs a
different function. See “Kinds of Callbacks” on page 8-2 for a list of callback
properties and the components to which each applies.
GUIDE i nitially sets the value of the most commonly used callback properties
for each component to
%automatic. For example, a push button has five
callback properties,
ButtonDownFcn, Callback, Create Fcn , DeleteFcn,and
KeyPressFcn. GUIDE sets only the Callback property, the most commonly
used callback, to
%automatic. You can use the Property Inspector to set the
other callback properties to
%automatic. To do so, click th e pencil-and-paper
icon
next to the callback name. GUIDE immediately replaces % automatic
with a M ATLAB expre ssio n that is the GUI calling sequence for the callback.
Within the calling sequence, it constructs the callback name, for example,
the subfunction name, from the component
Tag property and the name of
the callback property.
8-11