From: <HIDDEN>
Path: news.mathworks.com!newsfeed-00.mathworks.com!webcrossing
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to add a new property to a handle?
Message-ID: <ef537ba.5@webcrossing.raydaftYaTP>
Date: Wed, 11 Apr 2007 15:34:00 -0400
References: <ev3kqk$cui$1@canopus.cc.umanitoba.ca> <ef537ba.1@webcrossing.raydaftYaTP> <ev3nli$g8b$1@canopus.cc.umanitoba.ca> <ef537ba.3@webcrossing.raydaftYaTP> <ef537ba.4@webcrossing.raydaftYaTP>
Lines: 19
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:402782



I've found out that when you add new properties using schema.prop(),
they are visible in get(handle(h)) but not in get(h), although being
available for use in both cases. So, in my code, I simply expose
handle(h).

Another limitation I've found is that neither inspect(h) nor
inspect(handle(h)) show user-defined properties - only the original
(factory) ones. Not a biggy, this one.

The function (UICOMPONENT) is now ready and posted on the
File-Exchange, as promised: <http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=14583>
 Anyone interested in the details is welcome to look inside this
m-file. In my humble opinion, it's an important enhancement to
uicontrol() & javacomponent(), but I'm biased...

Comments & feedback welcome.

Yair Altman