g_object_unref()



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?

also, I was trying to return the column back to its original state (just a
label for the header) with
	gtk_tree_view_column_set_widget(GTK_TREE_VIEW_COLUMN(mycol), NULL);

which the documentation says SHOULD work.  This caused the error:
	** CRITICAL **  file gtktreeviewcolumn.c: line 636
(gtk_tree_view_column_update_button): assertion `GTK_IS_LABEL
(current_child)' failed

If there is no simple remedy for this, I shall report it as a bug!

Regards,
Martyn




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