summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2011-12-11 00:06:50 -0500
committerRyan Lortie <desrt@desrt.ca>2011-12-19 12:51:11 -0500
commit9e3c4c6b03d550190f1152924a998b45a9181119 (patch)
treefd6ba1be09b911307b222030ace3d12973b77154 /examples
parent8bc7513a7b7f9a487cfb0b84cecdc9b973dd1b07 (diff)
downloadgtk+-9e3c4c6b03d550190f1152924a998b45a9181119.tar.gz
bloatpad: add 'New Window' menu item
Diffstat (limited to 'examples')
-rw-r--r--examples/bloatpad.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/examples/bloatpad.c b/examples/bloatpad.c
index 368c81fc80..62eb0d0035 100644
--- a/examples/bloatpad.c
+++ b/examples/bloatpad.c
@@ -138,6 +138,14 @@ bloat_pad_finalize (GObject *object)
}
static void
+new_activated (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ g_application_activate (user_data);
+}
+
+static void
show_about (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -149,7 +157,6 @@ show_about (GSimpleAction *action,
NULL);
}
-
static void
quit_app (GSimpleAction *action,
GVariant *parameter,
@@ -173,6 +180,7 @@ quit_app (GSimpleAction *action,
}
static GActionEntry app_entries[] = {
+ { "new", new_activated, NULL, NULL, NULL },
{ "about", show_about, NULL, NULL, NULL },
{ "quit", quit_app, NULL, NULL, NULL },
};
@@ -192,6 +200,9 @@ bloat_pad_startup (GApplication *application)
"<interface>"
" <menu id='app-menu'>"
" <section>"
+ " <item label='_New Window' action='app.new'/>"
+ " </section>"
+ " <section>"
" <item label='_About Bloatpad' action='app.about'/>"
" </section>"
" <section>"