Specifications
3 Laying Out GUIs and Setting Properties
3-52
The following table lists the various callback properties and briefly describes
the purpose of each callback. See the components’ property reference pages to
find out which callbacks apply to a specific component.
Adding Callbacks to the M-file
If you checked Generate callback function prototypes in the GUI Options
dialog, GUIDE automatically adds the most commonly used callbacks to the
GUI M-file. If you want GUIDE to include other callbacks in the GUI M-file and
provide names for them, you can do one of the following:
• In the Property Inspector, set the value of the callback property, e.g.,
KeyPressFcn, to the string %automatic. GUIDE adds the callback to the
M-file the next time you save the GUI.
Callback Property Description
ButtonDownFcn
Executes when the user presses a mouse button
while the pointer is on or within five pixels of a
component.
Callback
Performs the primary work of the component. It
executes, for example, when a user clicks a push
button or selects a menu item. See “The Tag
Property” on page 2-14 for additional information.
CreateFcn
Initializes the component when it is created. It
executes when the component is created, but before
it becomes visible.
DeleteFcn
Performs cleanup operations just before the
component is destroyed.
KeyPressFcn
Executes when the user presses a keyboard key and
the callback’s component has focus.
ResizeFcn
Executes when a user resizes a panel or button
group whose
Resize behavior is set to Other.
SelectionChangeFcn
Executes when a user selects a different radio
button or toggle button in a button group
component.