Re: widget with label



The easiest way to know for sure
is to check the file gtkbutton.c.


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

because in the former; the label is created
by the container.
        -Tristan

Fabio Zanetta wrote:

Question:

These two way to create a widget are *exactly* equivalent?

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

The second one is done internally by the first one?

Thanx

see you!

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



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