I struggled with this bug for a few hours, so I’m sharing it here.
With gtk 2.20, Gtk::Builder does NOT set the name property anymore.
I don’t really understand yet the diference between
gtk_widget_get_name and gtk_buildable_get_name, but for RG2, it means
you cannot anymore call #name to get the object id you set in glade,
if that object inherits from Gtk::Widget.
As a workaround, I wrote this in my code, since I have no use for
I tried to find where in the code this method gets added to
Gtk::Widget, but I never found.
I also added to gtk/src/gtkbuildable.c :
rb_define_method(cGtkBuildable, “name”, buildable_get_name, 0);
+rb_define_alias(cGtkBuildable, “builder_id”, “name”);
And calling builder_id works too.
Hope it helps people with Gtk 2.20.