notify(obj, eventName)
notify(obj, eventName, eventData)
| Parameter | Description |
|---|---|
| obj | a classdef handle object |
| eventName | an event name as a string |
| eventData | optional event data passed to listener callbacks |
notify runs listener callbacks registered for a classdef handle object event.
Callbacks receive the source object and the supplied event data.
d = [tempdir(), 'nelson_help_notify/'];
mkdir(d);
filewrite([d, '/NelsonHelpNotifyCounter.m'], ["classdef NelsonHelpNotifyCounter < handle"; " events"; " CountChanged"; " end"; "end"]);
addpath(d);
counter = NelsonHelpNotifyCounter();
lh = addlistener(counter, 'CountChanged', @(src, eventData) disp('changed'));
notify(counter, 'CountChanged');
delete(lh);
delete(counter)
| Version | Description |
|---|---|
| 2.0.0 | classdef event notification support added |