Re: GtkBuilder and widget names
- To: George Brink <siberianowl@xxxxxxxxx>
- Subject: Re: GtkBuilder and widget names
- From: Tristan Van Berkom <tvb@xxxxxxxxx>
- Date: Fri, 23 Dec 2011 15:44:56 +0900
- Cc: gtk-list@xxxxxxxxx
- In-reply-to: <jd0c0g$rtq$1@dough.gmane.org>
- References: <jd0c0g$rtq$1@dough.gmane.org>
Yes it's intended.
There is a way to access the name of the widget key in the builder file,
however I've always been a little ticked about that.
Can you name me one use case of how that would be useful ?
I think gtk_buildable_get_name() will return what you want, but
again... is there any reason why GTK+ should have that api ?
Cheers,
-Tristan
On Fri, Dec 23, 2011 at 7:46 AM, George Brink <siberianowl@xxxxxxxxx> wrote:
> I draw an UI in Glade, loaded it in with the GtkBuilder object.
> Now I am accessing one widget in this UI:
> ---
> GtkWidget *w = gtk_builder_get_object(builder, "obj1");
> g_message(gtk_widget_get_name(w));
> ----
> This prints GtkLabel, instead of obj1. Why? Is it intended behavior?
> How can I read "obj1" from the w?
>
> _______________________________________________
> gtk-list mailing list
> gtk-list@xxxxxxxxx
> http://mail.gnome.org/mailman/listinfo/gtk-list
_______________________________________________
gtk-list mailing list
gtk-list@xxxxxxxxx
http://mail.gnome.org/mailman/listinfo/gtk-list
[GIMP Users]
[Yosemite News]
[Yosemite Photos]
[Gimp's Home]
[Steve's Art]