- 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();
- }