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

Re: Gdeb



On Tue, 8 Dec 1998, Lalo Martins wrote:
> Gdeb is nowhere near completion, but I pushed it to a state
> where people can criticize (ie flame) my class interface, check
> my pointers (GTK+ confuses me a lot about who frees what) and,
> assuming the pointers are O.K., it can already (surprise!) be
> linked into gnome-apt.
> 

All you need to know is:

1. If it's in a container, it will be destroyed with the container.
2. If it's a toplevel container (i.e. not in a container) you should
call gtk_widget_destroy.
3. If you need to transfer it between two containers, you should do this 
or you will eat flaming death:

gtk_widget_ref(widget);
gtk_container_remove(container1, widget);
// failure to call _ref() will result in a destroy here.
gtk_container_add(container2, widget); // or pack_start or whatever
gtk_widget_unref(widget); // it's now safely ref'd by the container.

Easy eh?

BTW, gtk_clist_set_policy is dead; you need to pack CList into a
ScrolledWindow, then set_policy on the ScrolledWindow, in the newer Gtk.

This is a major gap in gnome-apt, so I think I'm going to go ahead and
merge this in, making a whole lot of changes along the way I think. Adding
the _() i18n macro alone is going to result in a huge diff. I think I also
want to clean it up and make it more C++-like, and rearrange the files to
fit in my directory structure and build. Hope this is OK. You can monitor
my actions on CVS of course. :-)

Thanks,
Havoc


Reply to: