Re: convenient graphical object syntax [message #72957] |
Wed, 13 October 2010 16:39 |
penteado
Messages: 866 Registered: February 2018
|
Senior Member Administrator |
|
|
On Oct 13, 8:28 pm, Paul <paulsta...@gmail.com> wrote:
> Is there an IDL object class that I can inherit to take advantage of
> the convenient '.' notation the new IDL graphics objects use? I'd like
> to be able to use it more generally.
>
> I'd like to be able to do
> myObject.someProperty = someValue
> instead of
> myObject.setProperty, property=someValue
>
> and
>
> PRINT, myObject.someProperty
> instead of
> myObject.getProperty, someProperty=someValue
> PRINT, someValue
>
> Can this be done in less than a fortnight? Is the trick learning to
> use the IDL_Object to override the '.' operator?
You just need to inherit from the IDL_Object class. The . overloading
is automatic, as long as you have get/setproperty methods.
|
|
|