]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/notebook.cpp
compilation fixes
[wxWidgets.git] / src / gtk / notebook.cpp
index c65f67eb77fcc11f558211bd8f5ce843154e008f..91114c04914d39bf28355a2912dec3cb80dd30c5 100644 (file)
@@ -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;
 }