--- gtk/gtkbuilder.c.old	2008-10-17 08:06:19.000000000 +0400
+++ gtk/gtkbuilder.c	2009-03-12 12:32:38.000000000 +0300
@@ -872,6 +872,27 @@
   return g_hash_table_lookup (builder->priv->objects, name);
 }
 
+/**
+ * gtk_builder_get_object_name:
+ * @builder: a #GtkBuilder
+ * @object: object to get the name of
+ *
+ * Gets the name of the object @object.
+ *
+ * Return value: the name of the object @object.
+ **/
+const gchar *
+gtk_builder_get_object_name (GtkBuilder  *builder,
+                             GObject *object)
+{
+  GValue value = {};
+  g_return_val_if_fail (object != NULL, NULL);
+
+  g_value_init (&value, G_TYPE_STRING);
+  g_object_get_property (object, "name", &value);
+  return g_value_get_string (&value);
+}
+
 static void
 object_add_to_list (gchar    *object_id,
                     GObject  *object,
--- gtk/gtkbuilder.h.old	2008-10-17 08:06:19.000000000 +0400
+++ gtk/gtkbuilder.h	2009-03-12 11:37:51.000000000 +0300
@@ -112,6 +112,8 @@
 GObject*     gtk_builder_get_object              (GtkBuilder    *builder,
                                                   const gchar   *name);
 GSList*      gtk_builder_get_objects             (GtkBuilder    *builder);
+const gchar* gtk_builder_get_object_name         (GtkBuilder    *builder,
+                                                  GObject       *object);
 void         gtk_builder_connect_signals         (GtkBuilder    *builder,
 						  gpointer       user_data);
 void         gtk_builder_connect_signals_full    (GtkBuilder    *builder,
