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.1@webcrossing.raydaftYaTP>
Date: Thu, 5 Apr 2007 16:41:06 -0400
References: <ef537ba.-1@webcrossing.raydaftYaTP> <ev3kqk$cui$1@canopus.cc.umanitoba.ca>
Lines: 23
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:401887



Walter Roberson wrote:

> Is there a strong reason to do it as a property? Would
> setappdata() and kin be sufficient for your purposes?
> Or if you need to be able to findobj() on the property, you
> could set the property encoded into the Tag and use -regexp to
match the tag prefix.

The reason is that I'm trying to expand uicontrol to accept all sorts
of other GUI elements (like javax.swing.JSpinner etc.). I planned to
use javacomponent(), but this function returns separate handles for
the container and the java object. My plan was to dynamically add the
java object's properties to the Matlab container, and then use
linkprop() to keep these properties synchronized between the handles.
Then the user would be able to set/get JSpinner's properties just
like a togglebutton or an editbox, instead of having to manipulate 2
separate object handles (non-trivial for most Matlab users).
User-friendliness is the keyword here.

I promise to post the result on the File Exchange if enybody could
help me with this...

Yair Altman