- wxCHECK_MSG( n < GetPageCount(), wxNOT_FOUND,
- _T("invalid page index in wxListbook::SetSelection()") );
-
- const int selOld = m_selection;
-
- if ( (int)n != m_selection )
- {
- if ( m_selection != wxNOT_FOUND )
- m_pages[m_selection]->Hide();
- wxWindow *page = m_pages[n];
- page->SetSize(GetPageRect());
- page->Show();
-
- // change m_selection only now to ignore the selection change event
- m_selection = n;
-
- m_list->Select(n);
- m_list->Focus(n);
- }