]> git.saurik.com Git - wxWidgets.git/commitdiff
fixes #12579
authorStefan Csomor <csomor@advancedconcepts.ch>
Tue, 22 Mar 2011 06:44:08 +0000 (06:44 +0000)
committerStefan Csomor <csomor@advancedconcepts.ch>
Tue, 22 Mar 2011 06:44:08 +0000 (06:44 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@67272 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/osx/menu_osx.cpp

index a24b9c291008e40f09a9b7cfe0e9d02730b348ec..964915949f9b7c5e8e6d700cc567c35bc02fc57c 100644 (file)
@@ -497,6 +497,8 @@ wxMenuBar* wxMenuBar::s_macCommonMenuBar = NULL ;
 bool     wxMenuBar::s_macAutoWindowMenu = true ;
 WXHMENU  wxMenuBar::s_macWindowMenuHandle = NULL ;
 
+const int firstMenuPos = 1; // to account for the 0th application menu on mac
+
 void wxMenuBar::Init()
 {
     m_eventHandler = this;
@@ -806,7 +808,7 @@ void wxMenuBar::EnableTop(size_t pos, bool enable)
 {
     wxCHECK_RET( IsAttached(), wxT("doesn't work with unattached menubars") );
 
-    m_rootMenu->FindItemByPosition( pos )->Enable(enable);
+    m_rootMenu->FindItemByPosition(pos+firstMenuPos)->Enable(enable);
 
     Refresh();
 }
@@ -841,8 +843,6 @@ wxString wxMenuBar::GetMenuLabel(size_t pos) const
 // wxMenuBar construction
 // ---------------------------------------------------------------------------
 
-const int firstMenuPos = 1; // to account for the 0th application menu on mac
-
 wxMenu *wxMenuBar::Replace(size_t pos, wxMenu *menu, const wxString& title)
 {
     wxMenu *menuOld = wxMenuBarBase::Replace(pos, menu, title);