diff --git a/src/aui/auibook.cpp b/src/aui/auibook.cpp index dcc83d68f9..e8f25b28d7 100644 --- a/src/aui/auibook.cpp +++ b/src/aui/auibook.cpp @@ -2989,6 +2989,8 @@ bool wxAuiNotebook::InsertPage(size_t page_idx, bool select, const wxBitmap& bitmap) { + page->Reparent(this); + wxAuiNotebookPage info; info.window = page; info.caption = caption; @@ -3019,6 +3021,10 @@ bool wxAuiNotebook::InsertPage(size_t page_idx, DoSizing(); active_tabctrl->DoShowHide(); + // adjust selected index + if(m_curpage >= (int) page_idx) + m_curpage++; + if (select) { SetSelectionToWindow(page);