]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/notebook_osx.cpp
Fix interface definition of GetMouseCursorAt
[wxWidgets.git] / src / osx / notebook_osx.cpp
index bbe6f0a4cdaff9da977bd6d0aef3c88f1cd7af90..50cc1bacfe927c570f6666e8cd93b1cafacf82a9 100644 (file)
@@ -177,8 +177,15 @@ wxNotebookPage* wxNotebook::DoRemovePage(size_t nPage)
 
     MacSetupTabs();
 
-    if (m_selection >= (int)GetPageCount())
-        m_selection = GetPageCount() - 1;
+    if ( m_selection >= (int)nPage )
+    {
+        if ( GetPageCount() == 0 )
+            m_selection = wxNOT_FOUND;
+        else
+            m_selection = m_selection ? m_selection - 1 : 0;
+
+        GetPeer()->SetValue( m_selection + 1 ) ;
+    }
 
     if (m_selection >= 0)
         m_pages[m_selection]->Show(true);