gtk2-perl / easily accessing objects properties



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)

which gives for example,

        $window->set('allow-shrink', 1)

or even manually implementing in our classes accessors to have:

        $window->set_allow_shrink(1)


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


What do you think?


-- 
Guillaume Cottenceau - http://people.mandrakesoft.com/~gc/



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