From 298773ec3355382c9815fe70925dc4e417da190b Mon Sep 17 00:00:00 2001 From: Benjamin Williams Date: Tue, 21 Nov 2006 07:46:24 +0000 Subject: [PATCH] current page bug fix in wxAuiNotebook git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/aui/auibook.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index deb7b9175f..4bab0fbbff 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2615,6 +2615,12 @@ bool wxAuiNotebook::InsertPage(size_t page_idx, m_tabs.InsertPage(page, info, page_idx); + // if that was the first page added, even if + // select is false, it must become the "current page" + // (though no select events will be fired) + if (!select && m_tabs.GetPageCount() == 1) + m_curpage = GetPageIndex(page); + wxAuiTabCtrl* active_tabctrl = GetActiveTabCtrl(); if (page_idx >= active_tabctrl->GetPageCount()) active_tabctrl->AddPage(page, info); -- 2.50.0