Re: IDL v5.1 impressions [message #11739] |
Fri, 15 May 1998 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Hi Folks,
I don't want to rain on the IDL 5.1 parade (because I like
it too), but I have noticed that almost all of my object
graphics programs are broken. :-(
Here is a simple program that illustrates the problem. This
program runs in IDL 5.0.3 and fails in IDL 5.1.
pro test
thisView = OBJ_NEW('IDLgrView')
thisModel = OBJ_NEW('IDLgrModel')
thisView->Add, thisModel
thisSurface = Obj_New("IDLgrSurface")
thisModel->Add, thisSurface
thisContainer = Obj_New('IDLgrContainer')
; The next line causes the following error:
;
; % IDLGRCONTAINER::ADD: Objects can only have one
; parent at a time: <ObjHeapVar10(IDLGRSURFACE)>
thisContainer->Add, thisSurface
end
My container object is where I put the assorted objects
I create so that they can be destroyed when the widget
program is destroyed. Apparently I cannot add a surface
object (or any other object) to both the model and
the container. Nor can I, for example, add the model
to both the view and the container.
This is reported to be a bug in the IDL 5.1 code, according
to RSI technical support, but other than that they aren't
telling me anything. (I should put JD on to them.)
Oddly, instead of being a bug, I think this is how it is
*suppose* to work! Some of you may remember me ranting
and raving about memory leakage from my object programs
earlier this year. I made the assumption then that anything
I added to the model would be cleaned up when the model
was cleanup up. That turned out NOT to be the case, which
is why I started adding anything and everything I created
to the container object.
But I think this behavior now is great. At least it makes
perfect sense to me.
Unfortunately, I am now at a point where I don't know HOW
to write object graphics code, unless I put a lot of
"which version of IDL" checks in my code. My question is this:
are we SURE this is a bug?
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|