- wxCHECK_MSG( m_widget != NULL, -1, _T("invalid notebook") );
-
- if (m_pages.Number() == 0) return -1;
-
- GtkNotebookPage *g_page = GTK_NOTEBOOK(m_widget)->cur_page;
- if (!g_page) return -1;
-
- wxNotebookPage *page = (wxNotebookPage *) NULL;
-
- wxNode *node = m_pages.First();
- while (node)
- {
- page = (wxNotebookPage*)node->Data();
-
- if ((page->m_page == g_page) || (page->m_page == (GtkNotebookPage*)NULL))
- {
- // page->m_page is NULL directly after gtk_notebook_append. gtk emits
- // "switch_page" then and we ask for GetSelection() in the handler for
- // "switch_page". otherwise m_page should never be NULL. all this
- // might also be wrong.
- break;
- }
- node = node->Next();
- }
-
- wxCHECK_MSG( node != NULL, -1, _T("wxNotebook: no selection?") );
-
- return page->m_id;
-}
-
-int wxNotebook::GetPageCount() const
-{
- // count only the pages which were already added to the notebook for MSW
- // compatibility (and, in fact, this behaviour makes more sense anyhow
- // because only the added pages are shown)
-
- int n = 0;
- for ( wxNode *node = m_pages.First(); node; node = node->Next() )
- {
- wxNotebookPage *page = (wxNotebookPage*)node->Data();