X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/04ff27d50429a2911ac98764eef9593be820c32c..bb0926cc0097e5b15c0b93dc01c25cb827b96c19:/src/gtk/notebook.cpp diff --git a/src/gtk/notebook.cpp b/src/gtk/notebook.cpp index c65f67eb77..91114c0491 100644 --- a/src/gtk/notebook.cpp +++ b/src/gtk/notebook.cpp @@ -560,12 +560,13 @@ bool wxNotebook::DeleteAllPages() wxASSERT_MSG( GetPageCount() == 0, _T("all pages must have been deleted") ); + InvalidateBestSize(); return wxNotebookBase::DeleteAllPages(); } bool wxNotebook::DeletePage( size_t page ) { - if ( m_selection == (int)m_pagesData.GetCount() - 1 ) + if ( m_selection != -1 && (size_t)m_selection >= page ) { // the index will become invalid after the page is deleted m_selection = -1; @@ -701,6 +702,7 @@ bool wxNotebook::InsertPage( size_t position, gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page", GTK_SIGNAL_FUNC(gtk_notebook_page_change_callback), (gpointer)this ); + InvalidateBestSize(); return TRUE; }