[gucharmap] window: Inherit from GtkApplicationWindow instead of GtkWindow
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gucharmap] window: Inherit from GtkApplicationWindow instead of GtkWindow
- Date: Wed, 16 May 2012 00:17:42 +0000 (UTC)
commit 5291ecc1ce07d3d29c48f6c586cc4e30d2538d61
Author: Florian MÃllner <fmuellner gnome org>
Date: Tue May 8 23:46:13 2012 +0200
window: Inherit from GtkApplicationWindow instead of GtkWindow
This is necessary to make use of the new GMenu API.
https://bugzilla.gnome.org/show_bug.cgi?id=674952
gucharmap/gucharmap-window.c | 2 +-
gucharmap/gucharmap-window.h | 4 ++--
gucharmap/main.c | 2 ++
3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gucharmap/gucharmap-window.c b/gucharmap/gucharmap-window.c
index 26b08e3..fadf2a8 100644
--- a/gucharmap/gucharmap-window.c
+++ b/gucharmap/gucharmap-window.c
@@ -37,7 +37,7 @@
static void gucharmap_window_class_init (GucharmapWindowClass *klass);
static void gucharmap_window_init (GucharmapWindow *window);
-G_DEFINE_TYPE (GucharmapWindow, gucharmap_window, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE (GucharmapWindow, gucharmap_window, GTK_TYPE_APPLICATION_WINDOW)
static void
show_error_dialog (GtkWindow *parent,
diff --git a/gucharmap/gucharmap-window.h b/gucharmap/gucharmap-window.h
index b24f10d..638019c 100644
--- a/gucharmap/gucharmap-window.h
+++ b/gucharmap/gucharmap-window.h
@@ -38,7 +38,7 @@ typedef struct _GucharmapWindowClass GucharmapWindowClass;
struct _GucharmapWindow
{
- GtkWindow parent;
+ GtkApplicationWindow parent;
GSettings *settings;
GucharmapCharmap *charmap;
@@ -63,7 +63,7 @@ struct _GucharmapWindow
struct _GucharmapWindowClass
{
- GtkWindowClass parent_class;
+ GtkApplicationWindowClass parent_class;
};
#define GUCHARMAP_ICON_NAME "accessories-character-map"
diff --git a/gucharmap/main.c b/gucharmap/main.c
index eecc024..e59893c 100644
--- a/gucharmap/main.c
+++ b/gucharmap/main.c
@@ -95,6 +95,8 @@ main (int argc, char **argv)
g_signal_connect (application, "activate",
G_CALLBACK (gucharmap_activate), NULL);
+ g_application_register (G_APPLICATION (application), NULL, NULL);
+
window = gucharmap_window_new (application);
screen = gtk_window_get_screen (GTK_WINDOW (window));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]