User`s guide

Customizing Callbacks in GUIDE
property for the push button, and Callback is one of the push button’s callback
properties. The
Tag property uniquely identifies a component w ithin the GUI.
The first time you save the GUI after adding a component, GUIDE adds
callbacks for that component to the code file and generates the callback
names using the current value of the
Tag property. If you change the default
Tag for any component, make sure that you have not duplicated any other
component’s
Tag value before you save yo ur GUI. GUID E issues a warning if
it determines that duplicate tags exist.
See “Changing Callbacks Assigned by GUIDE” on page 8-22 and “Default
Callback Properties in GUIDE” on page 8-11 for more information.
Callback Function Signatures
A function signature itemizes a function’s name, the number, order, and types
of its parameters, and any qualifiers that apply to the function. When you
use the Property Inspector to view a component of a GUI that you have
saved at least once, you see that its
Callback property is already set. When
GUIDE saves a GUI, it
Generates a callback signature and assigns it as the value of the
Callback
property
Adds to the GUI code file a template for the function to which the signature
point
The component may have other callbacks, for example a
CreateFcn or a
DeleteFcn, which GUIDE populates the same way. It is up to you to add code
tothetemplatetomakeacallbackdosomething.
For example, if you click the pencil-and-paper icon
for a push button’s
Callback property in the P roperty Inspector, GUIDE presents the GUI code
file in the MATLAB Editor and positions the cursor at the first line of the
callback. When GUIDE defines the function in the file as:
function pushbutton1_Call back(hObject, eventdata, handles)
then the function signature for the Callback property, shown in the Property
Inspector, is
8-17