]> git.saurik.com Git - wxWidgets.git/blobdiff - src/osx/notebook_osx.cpp
Preserve wxSlider value when changing its range in wxOSX too.
[wxWidgets.git] / src / osx / notebook_osx.cpp
index 110a36e9916afb6e8361326fb054ed6e76590da3..fb58c4850992b4d528dda2aa1135d190c8499329 100644 (file)
@@ -240,16 +240,7 @@ bool wxNotebook::InsertPage(size_t nPage,
         m_peer->SetValue( m_selection + 1 ) ;
     }
 
-    // some page should be selected: either this one or the first one if there
-    // is still no selection
-    int selNew = wxNOT_FOUND;
-    if ( bSelect )
-        selNew = nPage;
-    else if ( m_selection == wxNOT_FOUND )
-        selNew = 0;
-
-    if ( selNew != wxNOT_FOUND )
-        SetSelection( selNew );
+    DoSetSelectionAfterInsertion(nPage, bSelect);
 
     InvalidateBestSize();