Re: stupid question
- From: Federico Mena Quintero <federico helixcode com>
- To: miguel helixcode com
- Cc: lacage email enst fr, gnome-components-list gnome org
- Subject: Re: stupid question
- Date: Thu, 27 Apr 2000 11:20:01 -0500
> > I wellcome any answer because this _really_ makes me feel stupid.
> > I don't understand. What unrefs our GtkObjects ? after the destruction ?
>
> Typically you want to "gtk_objet_destroy" top-level windows, as Gtk+
> will keep its own reference to them from somewhere.
>
> For anything else, we must use the _unref versions of those.
Not quite.
Widgets are a special case of objects for a couple of reasons:
1. You normally don't own their base reference, as their
parent container owns it.
2. Widgets are a kind of objects that you *do* want to be
unconditionally destroyed at arbitrary times, instead of
waiting for every interested party to unref() it.
(2) is important because sometimes you do want something like a button
to just disappear, instead of waiting for everyone to unref() it.
So most of the time you either gtk_container_remove() a widget and it
will magically die if there are no other refcounts to it, or you will
gtk_widget_destroy() a widget and it will go away.
For normal objects, you should gtk_object_unref() them.
Federico
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]