External Interfaces Reference |
Unregister all events for control
Syntax
Description
h.unregisterallevents
unregisters all events that have previously been registered with control, h
. After calling unregisterallevents
, the control will no longer respond to any events until you register them again using the registerevent function.
unregisterallevents(h)
is an alternate syntax for the same operation.
Examples
Create an mwsamp
control, registering three events and their respective handler routines. Use the eventlisteners function to see the event handler used by each event:
f = figure ('position', [100 200 200 200]); h = actxcontrol('mwsamp.mwsampctrl.2', [0 0 200 200], f, ... {'Click' 'myclick'; 'DblClick' 'my2click'; ... 'MouseDown' 'mymoused'}); h.eventlisteners ans = 'click' 'myclick' 'dblclick' 'my2click' 'mousedown' 'mymoused'
Unregister all of these events at once with unregisterallevents
. Now, calling eventlisteners
returns an empty cell array, indicating that there are no longer any events registered with the control:
To unregister specific events, use the unregisterevent function. First, create the control and register three events:
f = figure ('position', [100 200 200 200]); h = actxcontrol('mwsamp.mwsampctrl.2', [0 0 200 200], f, ... {'Click' 'myclick'; 'DblClick' 'my2click'; ... 'MouseDown' 'mymoused'});
Next, unregister two of the three events. The mousedown
event remains registered:
h.unregisterevent({'click' 'myclick'; 'dblclick' 'my2click'}); h.eventlisteners ans = 'mousedown' 'mymoused'
See Also
events
, eventlisteners
, registerevent
, unregisterevent
, isevent
set (COM) | unregisterevent |
© 1994-2005 The MathWorks, Inc.