Re: g_object_unref()



On Mon, Feb 17, 2003 at 03:00:54PM -0000, martyn 2 russell bt com wrote:
> I am currently playing with gtk_tree_view_column_set_widget(...).
> 
> If I create a new label with 
> 	mylabel = gtk_label_new("my text") 
> 
> and I pass this as the widget, can I use 
> 	g_object_unref(mylabel);
> 
> so that when GTK is finished with it, the label will be free'd?
> also, Is this the same way that GtkMenu's should be free'd by unreferencing
> them after poping them up?

No, when you add a widget to a container in a hierarchy, you implicitly
pass ownership to the container. This is sensible because a parent less
widget is quite useless anyway (except a top window)




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