Re: Reparenting problem in the GnomeDock.




Federico Mena Quintero writes:
 > >  [2] I don't know why it was impossible.  I tried doing stuff like:
 > >  	gtk_object_ref (GTK_OBJECT (control->priv->widget));
 > >  	gtk_widget_unparent (control->priv->widget);
 > >  	gtk_object_unref (GTK_OBJECT (control->priv->widget));
 > >  	gtk_container_add (GTK_CONTAINER (control->priv->plug),
 > >                             control->priv->widget);
 > >  
 > >      where control->priv->widget is the GtkLabel, but this failed
 > >      pretty horribly, and I never found out why.
 > 
 > Move the unref() after the add(), otherwise the object will be
 > destroyed.  Here unparent() will remove the but-last reference of the
 > control->priv->widget.

    Oops, thanks for catching that.  Ok, I just tried it that way, and
it doesn't work.  I don't know why.  The widget's parent gets set, but 
it never draws itself.  I did make sure it was shown.

Nat



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