[gtk+] Add an example
- From: Ryan Lortie <ryanl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] Add an example
- Date: Mon, 19 Dec 2011 18:01:47 +0000 (UTC)
commit aa1faa7c70036f79f18512eb0b05dc8a6b076fde
Author: Matthias Clasen <mclasen redhat com>
Date: Sun Dec 4 19:16:08 2011 -0500
Add an example
gtk/gtkapplicationwindow.c | 25 +++++++++++++++++++++++++
1 files changed, 25 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 24adfce..43127c2 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -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
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]