Specifications
Interrupting Executing Callbacks
4-21
•drawnow
•figure
•
getframe
•pause
•waitfor
When MATLAB encounters one of these commands in a callback, it suspends
execution and processes the events in the event queue. The way MATLAB
handles an event depends on the event type and the setting of the callback
object’s
Interruptible property:
•Events that would cause another callback to execute (e.g., clicking a push
button or figure window mouse button actions) can execute the callback only
if the current callback object’s
Interruptible property is on.
•Events that cause the figure window to redraw execute the redraw
regardless of the value of the current callback object’s
Interruptible
property.
Note that callbacks defined for an object’s
DeleteFcn or CreateFcn or a figure’s
CloseRequestFcn or ResizeFcn interrupt an executing callback regardless of
the value of the object’s
Interruptible property.
What Happens to Events That Are Blocked – BusyAction Property
All objects have a BusyAction property that determines what happens to their
events when processed during noninterruptible callback routine execution.
BusyAction has two possible values:
•
queue – Keep the event in the event queue and process it after the
noninterruptible callback finishes.
•
cancel – Discard the event and remove it from the event queue.
Event Processing During Callback Execution
The following sequence describes how MATLAB processes events while a
callback executes:
1 If MATLAB encounters a drawnow, figure, getframe, pause, or waitfor
command in the callback routine, MATLAB suspends execution and begins
processing the event queue.