| Re: [Q] IDL 5.1, passing keyword params to subprocedures [message #12086] |
Sun, 28 June 1998 00:00 |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Darran Edmundson writes:
> I am trying to create a setproperty procedure for a class that contains
> several atomic IDL graphics objects. Something along the lines of:
>
> pro myclass::setproperty, _REF_EXTRA = ex
>
> self.axis1 -> setproperty, ['axis1_hide']
> self.axis2 -> setproperty, ['axis2_hide']
> [...]
> end
>
> which should accept calls like the following:
>
> a = obj_new('myclass')
> a->setproperty,axis1_hide=/hide
> a->setproperty,axis2_hide=/hide
>
> This and several variants I have tried don't work. Can you
> see what I am getting at and offer a decent solution?
How about something like this:
pro myclass::setproperty, _Ref_Extra=extra
self.axis1 -> setproperty, _Ref_Extra=extra
self.axis2 -> setproperty, _Ref_Extra=extra
[...]
end
which will accept calls like this:
a = obj_new('myclass')
a->setproperty, /hide
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/
|
|
|
|