diff --git a/src/univ/notebook.cpp b/src/univ/notebook.cpp index 74f23d8111..b801b9e29b 100644 --- a/src/univ/notebook.cpp +++ b/src/univ/notebook.cpp @@ -328,9 +328,6 @@ bool wxNotebook::InsertPage(size_t nPage, // it's enough to just redraw the tabs if ( nPages == 0 ) { - // always select the first tab to have at least some selection - bSelect = true; - Relayout(); Refresh(); } @@ -345,7 +342,11 @@ bool wxNotebook::InsertPage(size_t nPage, } else // pages added to the notebook are initially hidden { - pPage->Hide(); + // always select the first tab to have at least some selection + if ( nPages == 0 ) + ChangeSelection(0); + else + pPage->Hide(); } return true;