Index: gtk/gtkbuilder.c
===================================================================
--- gtk/gtkbuilder.c	(revisão 18223)
+++ gtk/gtkbuilder.c	(cópia de trabalho)
@@ -862,7 +862,7 @@
  * @user_data: arbitrary data that will be passed to the connection function.
  *
  * This function can be thought of the interpreted language binding
- * version of gtk_builder_signal_autoconnect(), except that it does not
+ * version of gtk_builder_connect_signals(), except that it does not
  * require gmodule to function correctly.
  *
  * Since: 2.12
@@ -1272,6 +1272,105 @@
   return g_quark_from_static_string ("gtk-builder-error-quark");
 }
 
+/**
+ * gtk_builder_load_objects:
+ *
+ * @resource: resource to load, depends on flags
+ * @translation_domain: domain or %NULL
+ * @flags: #GtkBuilderflags
+ * @signal_user_data: user data to send in to connected signals, or %NULL
+ * @error:
+ * @first_object_name: name of first object to fetch, or %NULL
+ * @Varargs: address of first object, then additional name, address pairs, ending with %NULL
+ *
+ * This is a convenience function for constructing a builder and fetching
+ * objects from it. A file is loaded from filename specified by @resource
+ * unless @flags contains #GTK_BUILDER_LOAD_BUFFER in which case a
+ * %NULL-terminated buffer will be loaded instead. @flags can also contain
+ * #GTK_BUILDER_CONNET_SIGNALS which means that signals will be connected
+ * after the resource is loaded. @signal_user_data can be specified to provide
+ * in user_data to all connected signal callbacks.
+ * To fetch objects from the constructed builder provide a sequence of
+ * pair of object name and object addresses.
+ *
+ * Here's a simple example:
+ * <informalexample><programlisting>
+ *  if (!gtk_builder_load_objects ("application.ui",
+ *                                 "fnobricator",
+ *                                 GTK_BUILDER_CONNECT_SIGNALS,
+ *                                 NULL,
+ *                                 &err,
+ *                                 "main_window", &main_window,
+ *                                 "statusbar", &statusbar,
+ *                                 NULL))
+ *        g_error (err->message);
+ * </programlisting></informalexample>
+ * 
+ * Return value: %TRUE on success, %FALSE
+ *
+ * Since: 2.12
+ **/
 
+gboolean
+gtk_builder_load_objects (const gchar      *resource,
+                          const gchar      *translation_domain,
+                          GtkBuilderFlags   flags,
+                          gpointer          signal_user_data,
+                          GError          **error,
+                          const gchar      *first_object_name,
+                          ...)
+{
+  GtkBuilder *builder;
+  va_list var_args;
+  GError *tmp_error = NULL;
+  const gchar *name;
+  gpointer *object_ptr;
+    
+  g_return_val_if_fail (resource != NULL, FALSE);
+
+  builder = gtk_builder_new ();
+  if (!builder)
+    return FALSE;
+
+  if (flags & GTK_BUILDER_LOAD_BUFFER)
+    gtk_builder_add_from_string (builder, resource, -1, &tmp_error);
+  else
+    gtk_builder_add_from_file (builder, resource, &tmp_error);
+
+  if (tmp_error)
+    {
+      if (error)
+        g_propagate_error (error, tmp_error);
+      return FALSE;
+    }
+
+  if (translation_domain)
+    gtk_builder_set_translation_domain (builder, translation_domain);
+
+  if (flags & GTK_BUILDER_CONNECT_SIGNALS)
+    gtk_builder_connect_signals (builder, signal_user_data);
+
+  name = first_object_name;
+  va_start (var_args, first_object_name);
+  while (name)
+    {
+      object_ptr = va_arg (var_args, gpointer);
+      
+      *object_ptr = gtk_builder_get_object (builder, name);
+      if (!*object_ptr)
+        {
+          g_warning ("Unknown object: %s", name);
+          continue;
+        }
+      g_object_ref (*object_ptr);
+      name = va_arg (var_args, gchar*);
+    }
+  va_end (var_args);
+
+  g_object_unref (builder);
+  
+  return TRUE;
+}
+			  
 #define __GTK_BUILDER_C__
 #include "gtkaliasdef.c"
Index: gtk/gtkbuilder.h
===================================================================
--- gtk/gtkbuilder.h	(revisão 18223)
+++ gtk/gtkbuilder.h	(cópia de trabalho)
@@ -37,6 +37,11 @@
 typedef struct _GtkBuilderClass   GtkBuilderClass;
 typedef struct _GtkBuilderPrivate GtkBuilderPrivate;
 
+typedef enum {
+  GTK_BUILDER_LOAD_BUFFER = 1 << 0,
+  GTK_BUILDER_CONNECT_SIGNALS = 1 << 1
+} GtkBuilderFlags;
+
 typedef enum
 {
   GTK_BUILDER_ERROR_INVALID_TYPE_FUNCTION,
@@ -111,6 +116,15 @@
 gboolean     gtk_builder_value_from_string_type  (GType        	 type,
                                                   const gchar  	*string,
                                                   GValue       	*value);
+
+gboolean     gtk_builder_load_objects (const gchar      *resource,
+				       const gchar      *translation_domain,
+				       GtkBuilderFlags   flags,
+				       gpointer          signal_user_data,
+				       GError          **error,
+				       const gchar      *first_object_name,
+				       ...) G_GNUC_NULL_TERMINATED;
+/* private */
 guint        _gtk_builder_flags_from_string      (GType      	 type,
 						  const char  	*string);
 
Index: gtk/gtk.symbols
===================================================================
--- gtk/gtk.symbols	(revisão 18223)
+++ gtk/gtk.symbols	(cópia de trabalho)
@@ -447,6 +447,7 @@
 gtk_builder_get_translation_domain
 gtk_builder_get_type G_GNUC_CONST
 gtk_builder_get_type_from_name
+gtk_builder_load_objects
 gtk_builder_new
 gtk_builder_set_translation_domain
 gtk_builder_connect_signals
Index: tests/buildertest.c
===================================================================
--- tests/buildertest.c	(revisão 18223)
+++ tests/buildertest.c	(cópia de trabalho)
@@ -183,19 +183,19 @@
     "  </object>"
     "</interface>";
 
-  builder = builder_new_from_string (buffer, -1, NULL);
-  gtk_builder_connect_signals (builder, NULL);
-
-  window = gtk_builder_get_object (builder, "window1");
+  gtk_builder_load_objects (buffer, NULL,
+			    GTK_BUILDER_LOAD_BUFFER |
+			    GTK_BUILDER_CONNECT_SIGNALS,
+			    NULL, NULL, "window1", &window, NULL);
   gtk_window_set_title (GTK_WINDOW (window), "test");
 
   g_return_val_if_fail (normal == 1, FALSE);
   g_return_val_if_fail (after == 1, FALSE);
   g_return_val_if_fail (object == 1, FALSE);
   g_return_val_if_fail (object_after == 1, FALSE);
+
+  g_object_unref (window);
   
-  g_object_unref (builder);
-  
   builder = builder_new_from_string (buffer_order, -1, NULL);
   gtk_builder_connect_signals (builder, NULL);
   window = gtk_builder_get_object (builder, "window1");
@@ -222,7 +222,6 @@
 
 gboolean test_uimanager_simple (void)
 {
-  GtkBuilder *builder;
   GObject *uimgr, *menubar;
   GObject *menu, *label;
   GList *children;
@@ -257,20 +256,19 @@
     "  </object>"
     "</interface>";
 
-  builder = builder_new_from_string (buffer, -1, NULL);
-
-  uimgr = gtk_builder_get_object (builder, "uimgr1");
+  gtk_builder_load_objects (buffer, NULL,
+			    GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL, "uimgr1", &uimgr, NULL);
+  
   g_return_val_if_fail (uimgr != NULL, FALSE);
   g_return_val_if_fail (GTK_IS_UI_MANAGER (uimgr), FALSE);
 
-  g_object_unref (builder);
+  g_object_unref (uimgr);
   
-  builder = builder_new_from_string (buffer2, -1, NULL);
+  gtk_builder_load_objects (buffer2, NULL,
+			    GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL, "menubar1", &menubar, NULL);
 
-  menubar = gtk_builder_get_object (builder, "menubar1");
-  g_return_val_if_fail (menubar != NULL, FALSE);
-  g_return_val_if_fail (GTK_IS_MENU_BAR (menubar), FALSE);
-
   children = gtk_container_get_children (GTK_CONTAINER (menubar));
   menu = children->data;
   g_return_val_if_fail (menu != NULL, FALSE);
@@ -284,7 +282,7 @@
   g_return_val_if_fail
     (strcmp (gtk_label_get_text (GTK_LABEL (label)), "File") == 0, FALSE);
   
-  g_object_unref (builder);
+  g_object_unref (menubar);
   
   return TRUE;
 }
@@ -353,7 +351,6 @@
 
 gboolean test_sizegroup (void)
 {
-  GtkBuilder * builder;
   const gchar buffer1[] =
     "<interface domain=\"test\">"
     "  <object class=\"GtkSizeGroup\" id=\"sizegroup1\">"
@@ -413,33 +410,36 @@
     "    </child>"
     "  </object>"
     "</interface>";
-  GObject *sizegroup;
+  GObject *sizegroup, *sizegroup2;
   GSList *widgets;
 
-  builder = builder_new_from_string (buffer1, -1, NULL);
-  sizegroup = gtk_builder_get_object (builder, "sizegroup1");
+  gtk_builder_load_objects (buffer1, NULL, GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL, "sizegroup1", &sizegroup, NULL);
+
   widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (sizegroup));
   g_return_val_if_fail (g_slist_length (widgets) == 2, FALSE);
   g_slist_free (widgets);
-  g_object_unref (builder);
+  g_object_unref (sizegroup);
 
-  builder = builder_new_from_string (buffer2, -1, NULL);
-  sizegroup = gtk_builder_get_object (builder, "sizegroup1");
+  gtk_builder_load_objects (buffer2, NULL, GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL, "sizegroup1", &sizegroup, NULL);
   widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (sizegroup));
   g_return_val_if_fail (g_slist_length (widgets) == 0, FALSE);
   g_slist_free (widgets);
-  g_object_unref (builder);
+  g_object_unref (sizegroup);
 
-  builder = builder_new_from_string (buffer3, -1, NULL);
-  sizegroup = gtk_builder_get_object (builder, "sizegroup1");
+  gtk_builder_load_objects (buffer3, NULL, GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL,
+			    "sizegroup1", &sizegroup,
+			    "sizegroup2", &sizegroup2, NULL);
   widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (sizegroup));
   g_return_val_if_fail (g_slist_length (widgets) == 2, FALSE);
   g_slist_free (widgets);
-  sizegroup = gtk_builder_get_object (builder, "sizegroup2");
-  widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (sizegroup));
+  g_object_unref (sizegroup);
+  widgets = gtk_size_group_get_widgets (GTK_SIZE_GROUP (sizegroup2));
   g_return_val_if_fail (g_slist_length (widgets) == 2, FALSE);
   g_slist_free (widgets);
-  g_object_unref (builder);
+  g_object_unref (sizegroup2);
   
   return TRUE;
 }
@@ -1226,7 +1226,6 @@
 
 gboolean test_dialog (void)
 {
-  GtkBuilder * builder;
   const gchar buffer1[] =
     "<interface>"
     "  <object class=\"GtkDialog\" id=\"dialog1\">"
@@ -1254,19 +1253,24 @@
   GObject *dialog1;
   GObject *button_ok;
   GObject *button_cancel;
+
+  gtk_builder_load_objects (buffer1, NULL, GTK_BUILDER_LOAD_BUFFER,
+			    NULL, NULL,
+			    "dialog1", &dialog1,
+			    "button_ok", &button_ok,
+			    "button_cancel", &button_cancel,
+			    NULL);
   
-  builder = builder_new_from_string (buffer1, -1, NULL);
-  dialog1 = gtk_builder_get_object (builder, "dialog1");
-  button_ok = gtk_builder_get_object (builder, "button_ok");
   g_return_val_if_fail (gtk_dialog_get_response_for_widget
                         (GTK_DIALOG (dialog1),
                          GTK_WIDGET (button_ok)) == 3, FALSE);
-  button_cancel = gtk_builder_get_object (builder, "button_cancel");
   g_return_val_if_fail (gtk_dialog_get_response_for_widget
                         (GTK_DIALOG (dialog1),
                          GTK_WIDGET (button_cancel)) == -5, FALSE);
   
-  g_object_unref (builder);
+  g_object_unref (button_ok);
+  g_object_unref (button_cancel);
+  g_object_unref (dialog1);
   
   return TRUE;
 }
Index: demos/gtk-demo/builder.c
===================================================================
--- demos/gtk-demo/builder.c	(revisão 18223)
+++ demos/gtk-demo/builder.c	(cópia de trabalho)
@@ -26,23 +26,22 @@
 do_builder (GtkWidget *do_widget)
 {
   static GtkWidget *window = NULL;
-  GtkBuilder *builder;
   GError *err = NULL;
   gchar *filename;
   
   if (!window)
     {
-      builder = gtk_builder_new ();
       filename = demo_find_file ("demo.ui", NULL);
-      gtk_builder_add_from_file (builder, filename, &err);
-      g_free (filename);
-      if (err)
+      if (!gtk_builder_load_objects (filename, NULL,
+				     GTK_BUILDER_CONNECT_SIGNALS,
+				     NULL, &err, "window1", &window, NULL))
 	{
 	  g_error ("ERROR: %s\n", err->message);
+	  g_error_free (err);
+	  g_free (filename);
 	  return NULL;
 	}
-      gtk_builder_connect_signals (builder, NULL);
-      window = GTK_WIDGET (gtk_builder_get_object (builder, "window1"));
+      g_free (filename);
     }
 
   if (!GTK_WIDGET_VISIBLE (window))
