Re: Confusion about IDLgrViewgroup [message #77361] |
Sat, 27 August 2011 13:56  |
Jianbao
Messages: 16 Registered: December 2008
|
Junior Member |
|
|
Oh well. Just found a work-around. You can group the attribute objects all together into an array, such as
<code>
attrObj = !null
attrObj = [attrObj, someAttrObj]
</code>
Then, you can destroy all the attribute objects by
<code>
obj_destroy, attrObj
</code>
That's it.
|
|
|
Re: Confusion about IDLgrViewgroup [message #77449 is a reply to message #77361] |
Mon, 29 August 2011 09:28  |
Michael Galloy
Messages: 1114 Registered: April 2006
|
Senior Member |
|
|
On 8/27/11 2:56 PM, Jim wrote:
> Oh well. Just found a work-around. You can group the attribute objects all together into an array, such as
> <code>
> attrObj = !null
> attrObj = [attrObj, someAttrObj]
> </code>
> Then, you can destroy all the attribute objects by
> <code>
> obj_destroy, attrObj
> </code>
>
> That's it.
Yes, this is the workaround.
I think this is a strange case since normally an object is either part
of the hierarchy in which case it is automatically cleaned up or it is
an attribute so it can be added to the IDLgrViewGroup to be cleaned up.
The docs say about the TITLE property of an axis:
> Note: Objects specified via this property are not automatically
> cleaned up when the IDLgrAxis object is destroyed.
>
> The IDLgrText object becomes a child of the IDLgrAxis object;
> therefore, to use the same IDLgrText object for multiple axes, you
> must use multiple IDLgrAxis objects."
So this particular attribute is also a child, but NOT automatically
cleaned up. This makes it necessary to use tricks like your workaround.
I'll have to add a note in the object graphics chapter about this case.
Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
|
|
|