]> git.saurik.com Git - wxWidgets.git/commitdiff
make sure update UI handlers are called for accelerators, #10130
authorPaul Cornett <paulcor@bullseye.com>
Fri, 31 Oct 2008 05:25:59 +0000 (05:25 +0000)
committerPaul Cornett <paulcor@bullseye.com>
Fri, 31 Oct 2008 05:25:59 +0000 (05:25 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@56616 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/gtk/menu.cpp

index bbbd626e99e3d7987206b5f2ea1723fa2f2f51d7..299de20d547afb18c67a87254faa856881d14696 100644 (file)
@@ -695,6 +695,16 @@ static void menu_hide(GtkWidget*, wxMenu* menu)
 }
 }
 
+// "can_activate_accel" from menu item
+extern "C" {
+static gboolean can_activate_accel(GtkWidget*, guint, wxMenu* menu)
+{
+    menu->UpdateUI();
+    // always allow our "activate" handler to be called
+    return true;
+}
+}
+
 IMPLEMENT_DYNAMIC_CLASS(wxMenu,wxEvtHandler)
 
 void wxMenu::Init()
@@ -832,6 +842,8 @@ bool wxMenu::GtkAppend(wxMenuItem *mitem, int pos)
         }
         else
         {
+            g_signal_connect(menuItem, "can_activate_accel",
+                G_CALLBACK(can_activate_accel), this);
             g_signal_connect (menuItem, "activate",
                               G_CALLBACK(menuitem_activate),
                               mitem);