if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
{
int sel = win->GetSelection();
+ if (sel == -1)
+ return TRUE;
wxGtkNotebookPage *nb_page = win->GetNotebookPage(sel);
wxCHECK_MSG( nb_page, FALSE, _T("invalid selection in wxNotebook") );
m_inSwitchPage = FALSE;
m_imageList = (wxImageList *) NULL;
- m_pagesData.DeleteContents( TRUE );
m_selection = -1;
m_themeEnabled = TRUE;
}
{
wxCHECK_MSG( m_widget != NULL, -1, wxT("invalid notebook") );
- wxCHECK_MSG( page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
+ wxCHECK_MSG( page >= 0 && page < (int)m_pagesData.GetCount(), -1, wxT("invalid notebook index") );
int selOld = GetSelection();
gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page );
- m_pagesData.DeleteObject(GetNotebookPage(page));
+ wxGtkNotebookPage* p = GetNotebookPage(page);
+ m_pagesData.DeleteObject(p);
+ delete p;
return client;
}