containers and reference counting



	I'm counfused about how reference counting works when widgets are
added to containers. Let's say I have the code

GtkBin *bin;
GtkWidget *widget;

...  (create the bin, widget)

gtk_container_add(GTK_CONTAINER(bin), widget);

Does the add increment the reference count for widget? Do I
need to gtk_widget_unref(widget) here?

If I later do

gtk_container_remove(GTK_CONTAINER(bin), widget);

does the remove unref the widget? Do I still have a widget, or
has it been destroyed?

                                                           Ron Steinke




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