No BSD License  

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

5.0

5.0 | 2 ratings Rate this file 6 Downloads (last 30 days) File Size: 5.59 KB File ID: #18301

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

by Yair Altman

 

12 Jan 2008 (Updated 14 Jan 2008)

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

| Watch this File

File Information
Description

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.

Example:
proplistener(gcf,{'Visible','NumberTitle'},{'PreGet','postSet'},@myFunc)

See more extensive help section within.

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

Acknowledgements
This submission has inspired the following:
UISplitPane - Split a container (figure/frame/uipanel) into two resizable sub-containers, changeloglabels v3
MATLAB release MATLAB 7.4 (R2007a)
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (2)
16 Jan 2008 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.

20 Nov 2008 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.

Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
gui tools Yair Altman 22 Oct 2008 09:42:34
example Yair Altman 22 Oct 2008 09:42:34
listener preset preget postset postget Yair Altman 22 Oct 2008 09:42:34
example Eric 17 Feb 2011 20:59:20

Contact us at files@mathworks.com