Creating Graphical User Interfaces Previous page   Next Page

Associating Callbacks with Components

A GUI can have many components. There must be some way of specifying which callback should run in response to a particular event for a particular component. The callback that runs when the user clicks a Yes button is usually different than the one that runs for the No button.

Defining Callback Properties

Each component or figure has callback properties that specify the callback that runs in response to the event defined for that property. For example, a push button's Callback property specifies the callback that runs when a user clicks the push button. You can specify the value of the push button's Callback property, as well as all other callback properties, as a

When an appropriate event occurs, it triggers execution of the MATLAB expression, the script or function contained in the M-file, the specified function, or the function associated with the function handle. The same is true for menus and for the figure itself.

See Kinds of Callbacks for a list of the available callbacks for each component.


Previous page  Files for Programmatically Created GUIs Callback Properties in GUIDE Next page

© 1994-2005 The MathWorks, Inc.