User`s guide

14 Manage Ca llback Executio n
Callback Sequencing and Interruption
In this section...
“Control C allback Execution and Interruption” on page 14-2
“Control Program E xecution Us ing Timer Objects” on page 14-11
Control Callback Execution and Interruption
“Order of Callback Execution” on page 14-3
“How the Interruptible Property Works” on page 14-4
“How the Busy Action Property Works” on page 14-5
“Example” on page 14-6
Callback execution is event driven and callbacks from different GUIs share
the same event queue. In general, callbacks are triggered by user events such
as a mouse click or key press . When a callback initiates, under this event
model you cannot know whether another callback is executing. If a callback is
executing, your code cannot tell which callback that is.
If a callback is e xecuting and the user triggers an event for which a callback
is defined, that callback attempts to interrupt the callback that is already
executing. When this occurs, MATLAB software processes the callbacks
according to the values of two properties:
The
Interruptible property of the object whose callback is already
executing. The
Interruptible property specifies whether the executing
callback can be interrupted. The default value for uicontrol objects is
'on',
allowing interruption.
The
BusyAction property of the object whose callback has just been
triggered and is about to execute. The
BusyAction property specifies
whether to queue thecallbacktoawaitexecutionorcancel the callback.
The default property value is
'queue'.
14-2