[libdazzle] shortcuts: tweak example app
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [libdazzle] shortcuts: tweak example app
- Date: Sat, 17 Jun 2017 21:51:48 +0000 (UTC)
commit 010e831646583308b093e34255cbbaec423f74f6
Author: Christian Hergert <chergert redhat com>
Date: Sat Jun 17 14:50:20 2017 -0700
shortcuts: tweak example app
- Add a g_print() so that we know things are working while we
are testing this stuff.
- Remove duplicate shortcut definitions to be sure the keytheme
file is doing what it is supposed to be doing.
examples/app/example-window.c | 10 ++++++----
1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/examples/app/example-window.c b/examples/app/example-window.c
index 93756fb..7b2d331 100644
--- a/examples/app/example-window.c
+++ b/examples/app/example-window.c
@@ -14,8 +14,8 @@ struct _ExampleWindow
G_DEFINE_TYPE (ExampleWindow, example_window, GTK_TYPE_WINDOW)
static const DzlShortcutEntry shortcuts[] = {
- { "com.example.window.NewDoc", "<control>n", N_("Editing"), N_("Documents"), N_("New Document"),
N_("Create a new document") },
- { "com.example.window.CloseDoc", "<control>w", N_("Editing"), N_("Documents"), N_("Close Document"),
N_("Close the current document") },
+ { "com.example.window.NewDoc", NULL, N_("Editing"), N_("Documents"), N_("New Document"), N_("Create a new
document") },
+ { "com.example.window.CloseDoc", NULL, N_("Editing"), N_("Documents"), N_("Close Document"), N_("Close the
current document") },
};
static void
@@ -24,6 +24,7 @@ new_document_cb (ExampleWindow *self,
{
g_assert (EXAMPLE_IS_WINDOW (self));
+ g_print ("New document!\n");
}
static void
@@ -32,6 +33,7 @@ close_document_cb (ExampleWindow *self,
{
g_assert (EXAMPLE_IS_WINDOW (self));
+ g_print ("Close document!\n");
}
static void
@@ -57,12 +59,12 @@ example_window_init (ExampleWindow *self)
dzl_shortcut_controller_add_command_callback (controller,
"com.example.window.NewDoc",
- "<control>n",
+ NULL,
(GtkCallback) new_document_cb, NULL, NULL);
dzl_shortcut_controller_add_command_callback (controller,
"com.example.window.CloseDoc",
- "<control>w",
+ NULL,
(GtkCallback) close_document_cb, NULL, NULL);
g_signal_connect_swapped (self,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]