Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!news.glorb.com!news.cse.ohio-state.edu!usenet01.sei.cmu.edu!nn.andrew.cmu.edu!pitt.edu!newsflash.concordia.ca!canopus.cc.umanitoba.ca!not-for-mail
From: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to add a new property to a handle?
Date: Thu, 5 Apr 2007 20:05:40 +0000 (UTC)
Organization: National Research Council Canada - Conseil national de rechereches Canada
Lines: 15
Message-ID: <ev3kqk$cui$1@canopus.cc.umanitoba.ca>
References: <ef537ba.-1@webcrossing.raydaftYaTP>
NNTP-Posting-Host: origin.ibd.nrc.ca
X-Trace: canopus.cc.umanitoba.ca 1175803540 13266 192.70.172.160 (5 Apr 2007 20:05:40 GMT)
X-Complaints-To: abuse@cc.umanitoba.ca
NNTP-Posting-Date: Thu, 5 Apr 2007 20:05:40 +0000 (UTC)
Originator: roberson@ibd.nrc-cnrc.gc.ca (Walter Roberson)
Xref: news.mathworks.com comp.soft-sys.matlab:401883



In article <ef537ba.-1@webcrossing.raydaftYaTP>,
Yair Altman <altmanyDEL@gmailDEL.comDEL> wrote:

>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.

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.
-- 
  Is there any thing whereof it may be said, See, this is new? It hath
  been already of old time, which was before us.       -- Ecclesiastes