comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Confusion about IDLgrViewgroup
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Confusion about IDLgrViewgroup [message #77362] Sat, 27 August 2011 08:42 Go to next message
Jianbao is currently offline  Jianbao
Messages: 16
Registered: December 2008
Junior Member
Hello folks,

I encountered a counterintuitive behavior when I was using IDLgrViewgroup. Here is the code.

<code>
viewgroup = obj_new('IDLgrViewgroup')
xtitle = obj_new('IDLgrText', string = 'x')
viewgroup->add, xtitle
xAxis = obj_new('IDLgrAxis', direction = 0)
xAxis->SetProperty, title = xtitle
</code>

When I ran this piece of code, IDL gave an error message saying that
% IDLGRAXIS::SETPROPERTY: Objects can only have one parent at a time: TITLE

I got this impression from Modern IDL by Michael Galloy that IDLgrViewgroup is useful to contain attribute objects for convenient destruction. But this example shows that if I use an IDLgrText object as an axis title, I have to destroy it explicitly, which seems absolutely dumb. Or am I missing something here?

Thank you very much.
Re: Confusion about IDLgrViewgroup [message #77448 is a reply to message #77362] Mon, 29 August 2011 11:23 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
Also, if you are using IDL 8.0 or later, you don't have to worry about
cleaning up at all. I don't necessarily advocate that yet, though, since
you never know who also might want to run your code and what version of
IDL they have.

Mike
--
Michael Galloy
www.michaelgalloy.com
Modern IDL, A Guide to Learning IDL: http://modernidl.idldev.com
Research Mathematician
Tech-X Corporation
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Confusion about IDLgrViewgroup
Next Topic: Printing array to text file

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 14:28:17 PDT 2025

Total time taken to generate the page: 0.88203 seconds