|
"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message
<ff8r0h$gdq$1@fred.mathworks.com>...
>
> 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:
>
http://www.mathworks.com/matlabcentral/fileexchange/loadFile
.do?objectId=14583
>
Yeah, this would definitely be the easiest route, but
unfortunately most of the interesting properties seem to be
read-only.
E.g.
>> p = findprop(handle(gca), 'XLim');
>> p.SetFunction = @mySetFunction;
Returns:
??? 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
back
> 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
properties.
> ...or ask Mathworks how to use AbortSet (ha ha...)
Hah, I wish.
|