Creating Graphical User Interfaces    

Types of Callbacks

The primary mechanism for implementing a GUI is programming the callback of the uicontrol objects used to build the interface. However, in addition to the uicontrol Callback property, there are other properties that enable you to define callbacks.

Callback Properties for All Graphics Objects

All graphics objects have three properties that enable you to define callback routines:

Callback Properties for Figures

Figures have additional properties that execute callback routines with the appropriate user action. Only the CloseRequestFcn has a callback defined by default:

Which Callback Executes

Clicking on an enabled uicontrol prevents any ButtonDownFcn and WindowButtonDownFcn callbacks from executing. If you click on an inactive uicontrol, a figure, or other graphics objects having callbacks defined, MATLAB first executes the WindownButtonDownFcn of the figure (if defined) and then ButtonDownFcn of the object targeted by the mouse click.


 Designing for Cross-Platform Compatibility Interrupting Executing Callbacks