[gtk+/wip/gmenu] GtkApplicationWindow: Add a GtkAccelGroup



commit fec1954d20ed1ce2c2ab0af1df63f4fc1d1b6da9
Author: Matthias Clasen <mclasen redhat com>
Date:   Mon Dec 5 17:10:17 2011 -0500

    GtkApplicationWindow: Add a GtkAccelGroup
    
    This will be used in the following patches.

 gtk/gtkapplicationwindow.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtkapplicationwindow.c b/gtk/gtkapplicationwindow.c
index 43127c2..24da226 100644
--- a/gtk/gtkapplicationwindow.c
+++ b/gtk/gtkapplicationwindow.c
@@ -25,6 +25,7 @@
 
 #include "gtkmodelmenu.h"
 #include "gactionmuxer.h"
+#include "gtkaccelgroup.h"
 #include "gtkintl.h"
 
 /**
@@ -81,6 +82,7 @@ struct _GtkApplicationWindowPrivate
 {
   GSimpleActionGroup *actions;
   GtkWidget *menubar;
+  GtkAccelGroup *accels;
 
   GMenu *app_menu_section;
   GMenu *menubar_section;
@@ -546,6 +548,7 @@ gtk_application_window_dispose (GObject *object)
   g_clear_object (&window->priv->app_menu_section);
   g_clear_object (&window->priv->menubar_section);
   g_clear_object (&window->priv->actions);
+  g_clear_object (&window->priv->accels);
 
   G_OBJECT_CLASS (gtk_application_window_parent_class)
     ->dispose (object);
@@ -559,6 +562,8 @@ gtk_application_window_init (GtkApplicationWindow *window)
   window->priv->actions = g_simple_action_group_new ();
   window->priv->app_menu_section = g_menu_new ();
   window->priv->menubar_section = g_menu_new ();
+  window->priv->accels = gtk_accel_group_new ();
+  gtk_window_add_accel_group (GTK_WINDOW (window), window->priv->accels);
 
   /* window->priv->actions is the one and only ref on the group, so when
    * we dispose, the action group will die, disconnecting all signals.



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