From: <HIDDEN>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: How to add a new property to a handle?
Message-ID: <ef537ba.-1@webcrossing.raydaftYaTP>
Date: Thu, 5 Apr 2007 15:52:57 -0400
Lines: 17
NNTP-Posting-Host: 80.178.76.226
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
Xref: news.mathworks.com comp.soft-sys.matlab:401880



How can I add a new property to a handle-graphics handle (like the
one returned by uicontrol)? For example, adding new property 'MyProp'
so that set or get(h,'MyProp') would work.

I tried using addproperty, but it only works on COM objects.

I tried to use schema.prop(classhandle(handle(h)),'MyProp',...) but
it won't allow me to change an existing class.

I can create a new class (schema.class(findpackage('hg'),'MyClass')
with the existing props and my new prop, but I can't figure out how
to attach it to a new or existing HG handle.

Anyone know how to do this or give me some hint?

Thanks,
Yair Altman