From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Aborting a set in a PropertyPreSet listener callback
Date: Thu, 18 Oct 2007 23:42:09 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 34
Message-ID: <ff8r0h$gdq$>
References: <ff86su$p1i$>
Reply-To: <HIDDEN>
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: 1192750929 16826 (18 Oct 2007 23:42:09 GMT)
NNTP-Posting-Date: Thu, 18 Oct 2007 23:42:09 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: comp.soft-sys.matlab:433664

"Darik " <dgambleDEL@uwaterlooDEL.caDEL> wrote in message
> Is there a way to abort a requested SET call in a 
> PropertyPreSet listener callback? 
> schema.prop objects have an access flag called 'AbortSet' 
> that would suggest this is possible, but I haven't found 
> anything digging through Mathworks' code. 
> I know I COULD create a corresponding PropertyPostSet 
> listener to 'undo' whatever was done, but this gets pretty 
> unwieldy with linked properties (i.e. setting the XLim 
> property of an axes changes the XLimMode, XTick, etc.)

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

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

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

Yair Altman