Quantcast

Documentation Center

  • Trial Software
  • Product Updates

addlistener

Class: qrandstream

Add listener for event

Syntax

el = addlistener(hsource,'eventname',callback)
el = addlistener(hsource,property,'eventname',callback)

Description

el = addlistener(hsource,'eventname',callback) creates a listener for the event named eventname, the source of which is handle object hsource. If hsource is an array of source handles, the listener responds to the named event on any handle in the array. callback is a function handle that is invoked when the event is triggered.

el = addlistener(hsource,property,'eventname',callback) adds a listener for a property event. eventname must be one of the strings 'PreGet', 'PostGet', 'PreSet', and 'PostSet'. property must be either a property name or cell array of property names, or a meta.property or array of meta.property. The properties must belong to the class of hsource. If hsource is scalar, property can include dynamic properties.

For all forms, addlistener returns an event.listener. To remove a listener, delete the object returned by addlistener. For example, delete(el) calls the handle class delete method to remove the listener and delete it from the workspace.

See Also

| | | | | | |

Was this topic helpful?