diff --git a/include/wx/menu.h b/include/wx/menu.h index b0877afc98..22360496bf 100644 --- a/include/wx/menu.h +++ b/include/wx/menu.h @@ -261,7 +261,7 @@ public: // // NB: avoid calling SetInvokingWindow() directly if possible, use // wxMenuInvokingWindowSetter class below instead - void SetInvokingWindow(wxWindow *win); + virtual void SetInvokingWindow(wxWindow *win); wxWindow *GetInvokingWindow() const { return m_invokingWindow; } // the window associated with this menu: this is the invoking window for diff --git a/include/wx/osx/menu.h b/include/wx/osx/menu.h index 26544dc415..96e3515b2a 100644 --- a/include/wx/osx/menu.h +++ b/include/wx/osx/menu.h @@ -36,6 +36,8 @@ public: virtual void SetTitle(const wxString& title) wxOVERRIDE; + virtual void SetInvokingWindow(wxWindow* win) wxOVERRIDE; + bool ProcessCommand(wxCommandEvent& event); // get the menu handle diff --git a/src/osx/menu_osx.cpp b/src/osx/menu_osx.cpp index ec05d0aa8c..cf6b26ff21 100644 --- a/src/osx/menu_osx.cpp +++ b/src/osx/menu_osx.cpp @@ -421,6 +421,14 @@ void wxMenu::Attach(wxMenuBarBase *menubar) } #endif +void wxMenu::SetInvokingWindow(wxWindow* win) +{ + wxMenuBase::SetInvokingWindow(win); + + if ( win ) + SetupBitmaps(); +} + void wxMenu::SetupBitmaps() { for ( wxMenuItemList::compatibility_iterator node = m_items.GetFirst(); diff --git a/src/osx/window_osx.cpp b/src/osx/window_osx.cpp index 4792406b22..99cbfe1c7c 100644 --- a/src/osx/window_osx.cpp +++ b/src/osx/window_osx.cpp @@ -871,8 +871,6 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor) bool wxWindowMac::DoPopupMenu(wxMenu *menu, int x, int y) { #ifndef __WXUNIVERSAL__ - menu->SetupBitmaps(); - if ( x == wxDefaultCoord && y == wxDefaultCoord ) { wxPoint mouse = wxGetMousePosition();