Re: Gtk2 and inheritance



Goran Thyni wrote:

I think I should be doable,
can't see what harm removing "read-only" could do.
Fill me in here if we have cases where it could cause
problems.

Ok - I just removed the SvREADONLY_on and committed it.

regarding hashes:
my long experience in systeme development has tought me that
duplicating data and trying to keep two data sets in sync is
*pure evil*. Don't do it!

That's true, and not what I asked for ;) The old Gtk module builds a 
hash for each object, constructed this way:

 $foo = bless {
    _gtk => 1234567
 }, "Gtk::Foo";

where the 1234567 is the pointer of the correspondent Gtk C structure. 
So we have no data duplication here, but a handy and extensible Perl 
data structure, which admittedly introduces hash overhead. So I'm 
completely with you, that the Gtk2 way is better - new attributes can be
attached using set_data/get_data. And because inheriting is not so 
common, having some overhead here is better than having overhead for all
Gtk2 objects.

Regards,

Joern

-- 
Think, before you code.




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