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.
This commit is contained in:
Matthias Clasen 2009-11-08 21:34:29 -05:00
parent c7e4a1a012
commit c605474fa9
2 changed files with 14 additions and 1 deletions

View 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 <child> 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 <child>
A tab child can be specified without specifying a <child>
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[

View 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