Commit aa1faa7c authored by Matthias Clasen's avatar Matthias Clasen Committed by Allison Karlitskaya

Add an example

parent 898bc98d
......@@ -51,6 +51,31 @@
* automatically show the menu as part of a menubar. This behaviour
* can be overridden with the #GtkApplicationWindow:show-menubar
* property.
*
* <example><title>A GtkApplicationWindow with a menubar</title>
* <programlisting><![CDATA[
* app = gtk_application_new ();
*
* builder = gtk_builder_new ();
* gtk_builder_add_from_string (builder,
* "<interface>"
* " <menu id='menubar'>"
* " <submenu label='_Edit'>"
* " <item label='_Copy' action='win.copy'/>"
* " <item label='_Paste' action='win.paste'/>"
* " </submenu>"
* " </menu>"
* "</interface>");
* g_application_set_menubar (G_APPLICATION (app),
* G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")));
* g_object_unref (builder);
*
* ...
*
* window = gtk_application_window_new (app);
* ]]>
* </programlisting>
* </example>
*/
struct _GtkApplicationWindowPrivate
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment