File Exchange

image thumbnail

PropListener - add a callback to property value get/set event

version 1.0 (5.59 KB) by

Attach a listener callback to a property value get/set event(s)



No License

This is an enhancement of Matlab's hidden and unsupported addlistener function (within the uitools folder). It attaches a listener callback to one or more property (or properties) get or set event(s).

Acceptable events are PreGet, PreSet, PostGet and PostSet, which are triggered immediately before/after a get/set event on a handle property value.


See more extensive help section within.

Note: relies on undocumented and unsupported Matlab functionality. Use at your own risk. Comments welcome

Comments and Ratings (4)


Igor (view profile)

Very nice function!
But broken since R2014b:
>> proplistener(gcf,{'Visible','NumberTitle'},{'PreGet','postSet'},@myFunc)
No constructor 'handle.listener' with matching signature found.
Error in proplistener>attachListener (line 106)
        hl = handle.listener(hContainer, hSrc, eventName, callback);
Error in proplistener (line 77)
            hTemp = attachListener(hContainer, hSrc, eventName{i}, callback);
(Same command works in R2014a)

Any chance to fix it?


Matthew Whitaker

Once again Yair saves a lot of frustration with his instructive and well written code. Until I get R2008 up this function nicely does the trick.

In my case coordinating the 'EdgeColo'r of a patch and a line's 'Color' property. Something linkprop can't do.

A. Price

I was able to use this function to update a graph every time the x-axis changed, without knowing much about how listeners work.

MATLAB Release
MATLAB 7.4 (R2007a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video