From: "Darik " <dgambleDEL@uwaterlooDEL.caDEL>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Aborting a set in a PropertyPreSet listener callback
Date: Fri, 19 Oct 2007 15:21:48 +0000 (UTC)
Organization: Waterloo
Lines: 50
Message-ID: <ffai2c$7dg$>
References: <ff86su$p1i$> <ff8r0h$gdq$>
Reply-To: "Darik " <dgambleDEL@uwaterlooDEL.caDEL>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1192807308 7600 (19 Oct 2007 15:21:48 GMT)
NNTP-Posting-Date: Fri, 19 Oct 2007 15:21:48 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 895526
Xref: comp.soft-sys.matlab:433757

"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message 
> I never tried it myself, but you can try one of two ways:
> 1) set the schema.prop's SetFunction to your own callback,
> in which you can abort or return the original value. Note
> that SetFunction is unsupported in Matlab 6, but is in 7
> (unsure about 6.5). See usage example in my uicomponent
> submission:

Yeah, this would definitely be the easiest route, but 
unfortunately most of the interesting properties seem to be 


>> p = findprop(handle(gca), 'XLim');
>> p.SetFunction = @mySetFunction;


??? The SetFunction for this property can not be modified.

Any way around this?

> 2) within your PropertyPreSet callback, retrieve the
> original value and use it to modify the suggestedValue 
> to the original value. This will effectively abort the
> property's modification.

This actually doesn't work, oddly enough. As far as I can 
tell, any set calls in the PropertyPreSet callback are 
overridden by the set call that triggered the listener 
callback in the first place. I can create a property to 
temporarily store the original value, which can then be 
replaced by a corresponding PropertyPostSet function, but 
as I said, this gets a bit hairy with multiple linked 

> ...or ask Mathworks how to use AbortSet (ha ha...)

Hah, I wish.