]> Pileus Git - ~andy/gtk/commitdiff
Add an example
authorMatthias Clasen <mclasen@redhat.com>
Mon, 5 Dec 2011 00:16:08 +0000 (19:16 -0500)
committerRyan Lortie <desrt@desrt.ca>
Mon, 19 Dec 2011 17:51:10 +0000 (12:51 -0500)
gtk/gtkapplicationwindow.c

index 24adfce16c7d75c98591e888f2b884043944e331..43127c217f66c59580fd7030f5632792c0567580 100644 (file)
  * 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
 {