]> git.saurik.com Git - wxWidgets.git/blobdiff - src/motif/menu.cpp
non-pch build fix
[wxWidgets.git] / src / motif / menu.cpp
index ed09c4e47d63e8425663b8fb0c68b3b293efec4a..68eee40b912576df6d7ed11c7e7060e78bcc65fe 100644 (file)
@@ -162,17 +162,14 @@ void wxMenu::SetTitle(const wxString& label)
 
 bool wxMenu::ProcessCommand(wxCommandEvent & event)
 {
-    bool processed = false;
+    // Try the menu's event handler first
+    wxEvtHandler * const handler = GetEventHandler();
+    bool processed = handler ? handler->SafelyProcessEvent(event) : false;
 
-    // Try the menu's event handler
-    if ( !processed && GetEventHandler())
-    {
-        processed = HandleWindowEvent(event);
-    }
     // Try the window the menu was popped up from (and up
     // through the hierarchy)
     if ( !processed && GetInvokingWindow())
-        processed = GetInvokingWindow()->ProcessEvent(event);
+        processed = GetInvokingWindow()->HandleWindowEvent(event);
 
     return processed;
 }