]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk1/menu.cpp
Added implementations for two cases of wxSystemSettingsNative::GetMetric to
[wxWidgets.git] / src / gtk1 / menu.cpp
index c3593081d8e8496aac462b18d5b23d67b4a97896..f4c539a1035812e5d54c4e075e61d8a48cc96776 100644 (file)
@@ -169,7 +169,7 @@ static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu )
 {
     if (g_isIdle) wxapp_install_idle_handler();
 
-    wxMenuEvent event( wxEVT_MENU_OPEN, -1 );
+    wxMenuEvent event( wxEVT_MENU_OPEN, -1, menu );
     event.SetEventObject( menu );
 
     wxEvtHandler* handler = menu->GetEventHandler();
@@ -729,6 +729,10 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
         pm = pm->GetParent();
     }
 
+    // FIXME: why do we have to call wxFrame::GetEventHandler() directly here?
+    //        normally wxMenu::SendEvent() should be enough, if it doesn't work
+    //        in wxGTK then we have a bug in wxMenu::GetInvokingWindow() which
+    //        should be fixed instead of working around it here...
     if (frame)
     {
         // If it is attached then let the frame send the event.
@@ -738,6 +742,7 @@ static void gtk_menu_clicked_callback( GtkWidget *widget, wxMenu *menu )
         commandEvent.SetEventObject(frame);
         if (item->IsCheckable())
             commandEvent.SetInt(item->IsChecked());
+        commandEvent.SetEventObject(menu);
 
         frame->GetEventHandler()->ProcessEvent(commandEvent);
     }