Re: gtk2-perl / a script to help converting basic functions



Daniel Lacroix <dlacroix erasme org> writes:

I find all thoses problems stranges. For me, when a user create a Gtk
object, he must destroy it. When object is packed into another object
you only have to destroy the root object. So the Gtk way of doing things
is sufficent.

With current gtk-perl, when perl destroys a Gtk::Window, it
automatically destroys the "actual" gtk window on the GUI. I like
this feature, it's logical and useful (because it's a toplevel
widget). If we do what you suggest, then we'd need to call
$window->destroy at the user level just before perl destroys the
Gtk::Window. This is another possibility, it's possible, but I
personally don't like it, I prefer it inside gtk2-perl, it's more
clean and more logical for the gtk2-perl users IMHO.

Also, don't forget the problem of destructing structs (GdkColor
etc) which we explicetely malloc. We need to free them, gtk won't
do that of course, since it doesn't even know about it except
when these structs are used to pass information to functions.


[...]

If you create such an object and don't use it for a widget then you have
to use the unref funtion of all GObject.

But using a DESTROY with unref on it is dangereous because those object
can be use by other part of Gtk while no more accessible by Perl.

Yep that was my preferred point when discussing about the GObject
hierarchy (point '2').


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



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