Navigation

Operators and Keywords

Function List:

C++ API

: addlistener (h, prop, fcn)

Register fcn as listener for the property prop of the graphics object h.

Property listeners are executed (in order of registration) when the property is set. The new value is already available when the listeners are executed.

prop must be a string naming a valid property in h.

fcn can be a function handle, a string or a cell array whose first element is a function handle. If fcn is a function handle, the corresponding function should accept at least 2 arguments, that will be set to the object handle and the empty matrix respectively. If fcn is a string, it must be any valid octave expression. If fcn is a cell array, the first element must be a function handle with the same signature as described above. The next elements of the cell array are passed as additional arguments to the function.

Example:

function my_listener (h, dummy, p1)
 fprintf ("my_listener called with p1=%s\n", p1);
endfunction

addlistener (gcf, "position", {@my_listener, "my string"})

See also: addproperty, hggroup.

Package: octave