X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f701d7abc1d35bdbee686cbe2b541b1b5119bf31..324dbfec39cc030027830a100239cb9a4e6624e8:/src/common/framecmn.cpp diff --git a/src/common/framecmn.cpp b/src/common/framecmn.cpp index 00ceb8bfe3..591382e187 100644 --- a/src/common/framecmn.cpp +++ b/src/common/framecmn.cpp @@ -19,25 +19,29 @@ #include "wx/menu.h" #include "wx/menuitem.h" +#ifndef __WXGTK__ void wxFrame::OnIdle(wxIdleEvent& WXUNUSED(event) ) { DoMenuUpdates(); } +#endif // update all menus void wxFrame::DoMenuUpdates() { wxMenuBar* bar = GetMenuBar(); + if ( bar != NULL ) { int nCount = bar->GetMenuCount(); for (int n = 0; n < nCount; n++) - DoMenuUpdates(bar->GetMenu(n)); + DoMenuUpdates(bar->GetMenu(n), (wxWindow*) NULL); } } // update a menu and all submenus recursively -void wxFrame::DoMenuUpdates(wxMenu* menu) +void wxFrame::DoMenuUpdates(wxMenu* menu, wxWindow* WXUNUSED(focusWin)) { + wxEvtHandler* evtHandler = GetEventHandler(); wxNode* node = menu->GetItems().First(); while (node) { @@ -48,7 +52,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) wxUpdateUIEvent event(id); event.SetEventObject( this ); - if (GetEventHandler()->ProcessEvent(event)) + if (evtHandler->ProcessEvent(event)) { if (event.GetSetText()) menu->SetLabel(id, event.GetText()); @@ -59,7 +63,7 @@ void wxFrame::DoMenuUpdates(wxMenu* menu) } if (item->GetSubMenu()) - DoMenuUpdates(item->GetSubMenu()); + DoMenuUpdates(item->GetSubMenu(), (wxWindow*) NULL); } node = node->Next(); }