Creating Graphical User Interfaces |
Properties that Affect Callback Execution
Because callbacks execute asynchronously in response to outside events, it is impossible to predict when a callback will run or what callback may already be running. Generally speaking, MATLAB queues the callbacks that are waiting to run until the one that is running can be interrupted or finishes execution. These two properties, BusyAction
and Interruptible
, let you influence this process. Except as noted, the value you assign each property applies to all callbacks of the given component.
See Interrupting Executing Callbacks for more information.
This property determines if a component's callbacks should attempt to interrupt a previously executing callback.
cancel
, the event is discarded and the callback does not execute.
queue
, and the Interruptible
property of the previously excuting callback is on
, the second callback is added to the event queue and executes in its turn after the first callback finishes execution or encounters a drawnow
, figure
, getframe
, pause
, or waitfor
command.
This property determines whether a component's callbacks can be interrupted. If a callback is executing and the user triggers an event (such as a mouse click) on an object for which a callback is defined, that callback attempts to interrupt the first callback. MATLAB processes the callbacks according to these factors:
Interruptible
property of the object whose callback is executing
drawnow
, figure
, getframe
, pause
, or waitfor
statements
usyAction
property of the object whose callback is waiting to execute
If the Interruptible
property of the object whose callback is executing is on
(the default), the callback can be interrupted. Whenever the callback calls one of the drawnow
, figure
, getframe
, pause
, or waitfor
functions, the function processes any events in the event queue, including the waiting callback, before performing its defined task.
If the Interruptible
property of the object whose callback is executing is off
, the callback cannot be interrupted (except by certain callbacks; see the note below). The BusyAction
property of the object whose callback is waiting to execute determines what happens to its interrupting callback.
Information About Component State | Properties that Affect Component Access |
© 1994-2005 The MathWorks, Inc.