Re: gtk2-perl / easily accessing objects properties


On Tue, Oct 29, 2002 at 06:03:36PM +0100, Guillaume Cottenceau wrote:
During an irc talk with Manish Singh, he suggested the following
idea (which appears nice to me).
For each object property, instead of either using the generic

        $obj->set(property_name, property_value)

That name is already taken by a similar method:
And those are already implemented by you a few day ago :-)
The above exampel should work with your $object->set().

or even manually implementing in our classes accessors to have:


I did this but used:
GET: $window->allow_shrink;
SET: $window->allow_shrink($flag);
which is shorter and cleaner.

we could change our perl objects so that hash access would be
generic wrappers to automatically call set_property with the
right property name and value, giving the following use:
        $obj->{sensitive} = 1
needs a tie or a copy, 
which slows down start time even if we don't use it


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]