Re: gtk_object_sink in glade_palette_init



Hello,

I maybe didn't express myself well enough. I could understand that a reference to an object is taken in order to not have it disappearing (/destroyed). But what I actually meant to ask, is : what's the use of first adding a reference, (because that's what's happening in my eyes), for removing the reference /just the statement after/. Because that's what's happening in my understanding.

Beware : I'm not-too-GTK-familiar, so maybe (/probably) I misunderstand the meaning of it all.

Kind regards,

PhB

David NeÄas (Yeti) wrote:

On Tue, Nov 28, 2006 at 07:32:14AM +0100, Philippe Bertin wrote:
In glade_palette_init, there's this piece of code :

   /* Add items tray (via a scrolled window) */
   priv->tray = gtk_vbox_new (FALSE, 0);
   g_object_ref (G_OBJECT (priv->tray));
   gtk_object_sink (GTK_OBJECT (priv->tray));

What's the goal of this gtk_object_sink?

I haven't read the code, but probably the vbox can be
temporarily removed from its container and should not cease
to exist when this happens so a reference is taken on it.



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