From 3d27b5746f360ea930bd1046fd61b1b27440ba7b Mon Sep 17 00:00:00 2001 From: David Elliott Date: Tue, 20 Jan 2004 02:57:06 +0000 Subject: [PATCH] When inserting a new menu don't try to find th eposition of the current one if the menubar is not yet attached. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25256 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/msw/menu.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/msw/menu.cpp b/src/msw/menu.cpp index 4be9908fcc..478048e703 100644 --- a/src/msw/menu.cpp +++ b/src/msw/menu.cpp @@ -977,7 +977,8 @@ bool wxMenuBar::Insert(size_t pos, wxMenu *menu, const wxString& title) { // Find out which MSW item before which we'll be inserting before // wxMenuBarBase::Insert is called and GetMenu(pos) is the new menu. - int mswpos = (pos == m_menus.GetCount()) + // If IsAttached() is false this won't be used anyway + int mswpos = (!IsAttached() || (pos == m_menus.GetCount())) ? -1 // append the menu : MSWPositionForWxMenu(GetMenu(pos),pos); -- 2.50.0