![Citation](https://forum.developpez.be/images/misc/quote_icon.png)
Envoyé par
documentation Matlab
How the Interruptible Property Works
An object's Interruptible property can be either on (the default) or off.
If theInterruptible property of the object whose callback is executing is on, the callback can be interrupted. However, it is interrupted only when it, or a function it triggers, calls drawnow, figure, getframe, pause, or waitfor. Before performing their defined tasks, these functions process any events in the event queue, including any waiting callbacks. If the executing callback, or a function it triggers, calls none of these functions, it cannot be interrupted regardless of the value of its object's Interruptible property.
If the Interruptible property of the object whose callback is executing is off, the callback cannot be interrupted with the following exceptions. If the interrupting callback is a DeleteFcn or CreateFcn callback or a figure's CloseRequest or ResizeFcn callback, it interrupts an executing callback regardless of the value of the executing callback object's Interruptible property. These callbacks too can interrupt only when a drawnow, figure, getframe, pause, or waitfor function executes.
The callback properties to which Interruptible can apply depend on the objects for which the callback properties are defined:
*For figures, only callback routines defined for the ButtonDownFcn, KeyPressFcn, KeyReleaseFcn, WindowButtonDownFcn, WindowButtonMotionFcn, WindowButtonUpFcn, and WindowScrollWheelFcn are affected by the Interruptible property.
For callbacks that can be issued continuously, such as most of the above, setting the figure's Interruptible property to 'off' might be necessary if callbacks from other objects or GUIs could fire while they are being issued. That is, do not interrupt callbacks that keep on coming if there is not a specific reason to do so.
*For GUI components, Interruptible applies to the ButtonDownFcn, Callback, CellSelectionCallback, KeyPressFcn, SelectionChangeFcn, ClickedCallback, OffCallback, and OnCallback properties, for the components for which these properties are defined.
To prevent continuously repeating callbacks such as the above from being interrupted, set the value of the Interruptible property of the object whose callback is repeating to 'off':
set(hObject,'Interruptible','off');
where hObject is the handle to the object whose callback is called continuously (for example, to load another GUIDE GUI).
Partager