X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/f2d8a2767ec3bc3d6c102d8958ee6b50dc1fa36c..71a09c3579dd5cb4cd8fa7fdc143561cbff74e12:/src/osx/notebook_osx.cpp?ds=sidebyside diff --git a/src/osx/notebook_osx.cpp b/src/osx/notebook_osx.cpp index bbe6f0a4cd..59a329d5e7 100644 --- a/src/osx/notebook_osx.cpp +++ b/src/osx/notebook_osx.cpp @@ -4,7 +4,6 @@ // Author: Stefan Csomor // Modified by: // Created: 1998-01-01 -// RCS-ID: $Id$ // Copyright: (c) Stefan Csomor // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -177,8 +176,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);