Re: widget with label
- From: Havoc Pennington <hp redhat com>
- To: Tristan Van Berkom <vantr touchtunes com>
- Cc: Fabio Zanetta <znt fabio virgilio it>, "GTK2.0" <gtk-app-devel-list gnome org>
- Subject: Re: widget with label
- Date: Tue, 12 Nov 2002 15:41:46 -0500
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]