| Re: iTool identifiers [message #48964 is a reply to message #48949] |
Wed, 07 June 2006 00:47   |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
Robbie wrote:
> Hello,
>
> I was wondering if anyone has used the iTool identifier system just by
> itself. I like the idea of using the iTool identifier system for
> keeping a track of objects, but I am not using iTools for my particular
> project.
>
> By the looks of it, I just have to:
> * Use IDLitContainer instead of IDL_Container
> * Use IDLitComponent as a base class
> * No change necessary for graphics atoms
> and I should be able to reference all objects from the context of the
> root IDL_Container
>
> Is it really that easy? Is it more convenient than using conventional
> object references? Does a global identifier system blur the segregation
> between modules?
I don't think it will be *that* easy.
IDL> o = obj_new('idlgrplot', findgen(11))
IDL> print, obj_isa(o, 'idlitcomponent')
1
IDL> help, o->getFullIdentifier()
<Expression> STRING = ''
I think you need to start the iTools system and have an iTool for most
components to have a valid identifier (since I think the component gets
its id when it is registered). Maybe there is some way to fake it? To
find out would require digging around the iTools source code.
But, maybe the NAME property for object graphics is good enough?
IDL> oview = obj_new('idlgrview')
IDL> omodel = obj_new('idlgrmodel', name='mymodel')
IDL> oview->add, omodel
IDL> oplot = obj_new('idlgrplot', findgen(11), name='myplot')
IDL> omodel->add, oplot
IDL> help, oview->getByName('mymodel/myplot')
<Expression> OBJREF = <ObjHeapVar10(IDLGRPLOT)>
I use this all the time so that I don't have to store object references
for many different objects in a hierarchy. Is this what you mean by "I
should be able to reference all objects from the context of the root
IDL_Container"?
Mike
--
www.michaelgalloy.com
|
|
|
|