[gtk+] Add GtkBuilder support for notebook action area.



commit c605474fa911e88ba6fb1bbf561658a87cb8816f
Author: Matthias Clasen <mclasen redhat com>
Date:   Sun Nov 8 21:34:29 2009 -0500

    Add GtkBuilder support for notebook action area.
    
    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 |    7 ++++++-
 gtk/gtknotebook.c                        |    8 ++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/docs/reference/gtk/tmpl/gtknotebook.sgml b/docs/reference/gtk/tmpl/gtknotebook.sgml
index 0dc9049..93e616a 100644
--- a/docs/reference/gtk/tmpl/gtknotebook.sgml
+++ b/docs/reference/gtk/tmpl/gtknotebook.sgml
@@ -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[
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index 2fd8ab0..b86f774 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]