Creating Graphical User Interfaces Previous page   Next Page

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.

BusyAction

This property determines if a component's callbacks should attempt to interrupt a previously executing callback.

Interruptible

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:

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.


Previous page  Information About Component State Properties that Affect Component Access Next page

© 1994-2005 The MathWorks, Inc.