Re: widget with label



On Tue, Nov 12, 2002 at 03:21:01PM -0500, Tristan Van Berkom wrote: 
I _think_ that:

b = gtk_button_new_with_label("hello!");

G_OBJECT(GTK_WIDGET(b)->child)->ref_count == 1

b = gtk_button_new();
l = gtk_label_new("hello!");
gtk_container_add(b, l);

G_OBJECT(GTK_WIDGET(b)->child)->ref_count == 2


Nope; the initial refcount on gtk_label_new() is "floating" so is
adopted by the container in gtk_container_add(), thus no extra
reference is added.

Havoc



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