[ghex] window: Inherit from GtkApplicationWindow instead of GtkWindow



commit 4c75a8de625defd3345c017864794b5964d1c602
Author: Kalev Lember <kalevlember gmail com>
Date:   Thu Aug 9 11:17:09 2012 +0300

    window: Inherit from GtkApplicationWindow instead of GtkWindow
    
    This is necessary to make use of the new GMenu API.

 src/ghex-window.c |    2 +-
 src/ghex-window.h |    4 ++--
 src/main.c        |    2 ++
 3 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/ghex-window.c b/src/ghex-window.c
index 6474097..1cd82d8 100644
--- a/src/ghex-window.c
+++ b/src/ghex-window.c
@@ -45,7 +45,7 @@
 #define GHEX_WINDOW_DEFAULT_WIDTH 320
 #define GHEX_WINDOW_DEFAULT_HEIGHT 256
 
-G_DEFINE_TYPE (GHexWindow, ghex_window, GTK_TYPE_WINDOW)
+G_DEFINE_TYPE (GHexWindow, ghex_window, GTK_TYPE_APPLICATION_WINDOW)
 
 static GList *window_list = NULL;
 static GHexWindow *active_window = NULL;
diff --git a/src/ghex-window.h b/src/ghex-window.h
index e9d92bb..0a48518 100644
--- a/src/ghex-window.h
+++ b/src/ghex-window.h
@@ -44,7 +44,7 @@ typedef struct _GHexWindowClass GHexWindowClass;
 
 struct _GHexWindow 
 {
-    GtkWindow win;
+    GtkApplicationWindow win;
 
     GtkHex    *gh;
     GtkWidget *vbox;
@@ -67,7 +67,7 @@ struct _GHexWindow
 
 struct _GHexWindowClass
 {
-    GtkWindowClass klass;
+    GtkApplicationWindowClass klass;
 };
 
 GType             ghex_window_get_type           (void) G_GNUC_CONST;
diff --git a/src/main.c b/src/main.c
index 5a6355e..d999571 100644
--- a/src/main.c
+++ b/src/main.c
@@ -120,6 +120,8 @@ main(int argc, char **argv)
 	g_signal_connect (application, "activate",
 	                  G_CALLBACK (ghex_activate), NULL);
 
+	g_application_register (G_APPLICATION (application), NULL, NULL);
+
 	if (args_remaining != NULL) {
 		gchar **filename;
 		for (filename = args_remaining; *filename != NULL; filename++) {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]