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

Home » Public Forums » archive » use of 'obj_new' within another object definition
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
use of 'obj_new' within another object definition [message #32961] Mon, 18 November 2002 13:48
wisehart is currently offline  wisehart
Messages: 2
Registered: November 2002
Junior Member
Hi,
I am experiencing a problem in IDL 5.4.

I create an object called 'my_object', and define it in a file called
'my_object__define.pro'

I do the same thing with 'other_object' , and
'other_object__define.pro'.

Both of these objects compile and i can create variables with them.
They both have 'init' functions that do basic initilization stuff.

I know that the 'init' functions are getting called because I can
put...

print,'i am here ...'

...statements in the init functions, and I will see the output when
i initialize an object of that type.

...


Now, my problem is that if I want 'my_object' to have an instance of
'other_object' as a member object, the init function( of
'other_object')
doesn't get called.

To eleborate...(snipping irrelevant stuff)

;----------------------------------
;my_object__define.pro

pro my_object__define

foo: obj_new('other_object')

end ; my_object


;------------------------------
;other_object__define.pro

function other_object::init
print, ' i am here!'
return, 1
end ; init

pro other_object__define

;object definition stuff here

end ; other_object
;----------------------------


When type ' x = obj_new('other_object') ' on the
command line, I see the ' i am here!'.

When type ' y = obj_new('my_object') ' on the
command line, I DON"T see the ' i am here!'.

Why is this?

I don't get any errors otherwise, and
according to the documentation on 'obj_new'
it seems it should call the 'init' function
in BOTH circumstances.

Any ideas greatly appreciated,

Paul Wisehart
wisehart@runbox.com
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Object Graphic Slows on resize
Next Topic: Printer/Plotter problem

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

Current Time: Wed Oct 08 19:53:25 PDT 2025

Total time taken to generate the page: 0.00455 seconds