X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/352cd79f633561e31c1718fbcd64fddbc442cb3c..fc5d9e38ee002c024be3019e37b63f1a1d88e7c2:/src/gtk/menu.cpp?ds=sidebyside diff --git a/src/gtk/menu.cpp b/src/gtk/menu.cpp index bbbd626e99..299de20d54 100644 --- a/src/gtk/menu.cpp +++ b/src/gtk/menu.cpp @@ -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);