This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English verison of the page.

Note: This page has been translated by MathWorks. Please click here
To view all translated materals including this page, select Japan from the country navigator on the bottom of this page.


Class: qrandstream

Add listener for event


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


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 'PreGet', 'PostGet', 'PreSet', or 'PostSet'. property must be either a property name or cell array of property names, or a or array of 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.

Was this topic helpful?