]> Pileus Git - ~andy/gtk/commitdiff
Add GtkBuilder support for notebook action area.
authorMatthias Clasen <mclasen@redhat.com>
Mon, 9 Nov 2009 02:34:29 +0000 (21:34 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Mon, 9 Nov 2009 02:34:29 +0000 (21:34 -0500)
Allow to place children into the notebooks action areas by using
"action-start" or "action-end" as the type.

docs/reference/gtk/tmpl/gtknotebook.sgml
gtk/gtknotebook.c

index 0dc90496af88d6112e4c31ad7dfd5e5972e2250a..93e616af097ceb0e2e0c8e03dfb316f362052ba3 100644 (file)
@@ -26,9 +26,14 @@ The GtkNoteboopk implementation of the GtkBuildable interface
 supports placing children into tabs by specifying "tab" as the
 "type" attribute of a &lt;child&gt; element. Note that the content
 of the tab must be created before the tab can be filled.
-A tab child can be specified without specifying a &lt;child&gt; 
+A tab child can be specified without specifying a &lt;child&gt;
 type attribute.
 </para>
+<para>
+To add a child widget in the notebooks action area, specify
+"action-start" or "action-end" as the "type" attribute of the &lt;child&gt;
+element.
+</para>
 <example>
 <title>A UI definition fragment with GtkNotebook</title>
 <programlisting><![CDATA[
index 2fd8ab06e7aa3b6e3f82de0967a33b6237e2a6a6..b86f7742682c342a4776389f09cf5cd08291c815 100644 (file)
@@ -1148,6 +1148,14 @@ gtk_notebook_buildable_add_child (GtkBuildable  *buildable,
       g_assert (page != NULL);
       gtk_notebook_set_tab_label (notebook, page, GTK_WIDGET (child));
     }
+  else if (type && strcmp (type, "action-start") == 0)
+    {
+      gtk_notebook_set_action_widget (notebook, GTK_WIDGET (child), GTK_PACK_START);
+    }
+  else if (type && strcmp (type, "action-end") == 0)
+    {
+      gtk_notebook_set_action_widget (notebook, GTK_WIDGET (child), GTK_PACK_END);
+    }
   else if (!type)
     gtk_notebook_append_page (notebook, GTK_WIDGET (child), NULL);
   else