addlistener (handle) - Create event listener

Syntax

lh = addlistener(Hsource,'EventName',callback)
lh = addlistener(Hsource,property,'EventName',callback)

Description

lh = addlistener(Hsource,'EventName',callback)) creates a listener for the specified event.

lh = addlistener(Hsource,property,'EventName',callback) creates a listener for one of the predefined property events. There are four property events:

See Defining Events and Listeners — Syntax and Techniques for more information.

Arguments

Hsource

Handle of the object that is the source of the event, or an array of source handles.

EventName

Name of the event, which is triggered by the source objects.

callback

Function handle referencing a function to execute when the event is triggered.

property

Character string that can be:

If Hsource is a scalar, then any of the properties can be dynamic properties. If Hsource is non-scalar, then the properties must belong to the class of Hsource and can not include dynamic properties (which are not part of the class definition).

For more information, see the following sections:

lh

Handle of the event.listener object returned by addlistener.

See Also

handle, notify (handle)

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS