X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/07b8d7ecc39cfc6cce17156b91c6de1cfb56ce5b..4fa0a5b44341885a0886f2ae6723d2441bd1f62f:/src/gtk1/notebook.cpp?ds=sidebyside diff --git a/src/gtk1/notebook.cpp b/src/gtk1/notebook.cpp index 1754454371..9d70d97f45 100644 --- a/src/gtk1/notebook.cpp +++ b/src/gtk1/notebook.cpp @@ -21,9 +21,9 @@ #include "wx/intl.h" #include "wx/log.h" -#include -#include +#include "wx/gtk/private.h" #include "wx/gtk/win_gtk.h" + #include // ---------------------------------------------------------------------------- @@ -522,14 +522,11 @@ bool wxNotebook::DeleteAllPages() wxASSERT_MSG( GetPageCount() == 0, _T("all pages must have been deleted") ); - return TRUE; + return wxNotebookBase::DeleteAllPages(); } bool wxNotebook::DeletePage( int page ) { - wxGtkNotebookPage* nb_page = GetNotebookPage(page); - wxCHECK_MSG( nb_page, FALSE, _T("invalid page in wxNotebook::DeletePage") ); - // GTK sets GtkNotebook.cur_page to NULL before sending the switch page // event so we have to store the selection internally if ( m_selection == -1 ) @@ -542,25 +539,23 @@ bool wxNotebook::DeletePage( int page ) } } - m_pagesData.DeleteObject( nb_page ); - + // it will call our DoRemovePage() to do the real work return wxNotebookBase::DeletePage(page); } wxNotebookPage *wxNotebook::DoRemovePage( int page ) { - wxGtkNotebookPage* nb_page = GetNotebookPage(page); + wxNotebookPage *client = wxNotebookBase::DoRemovePage(page); + if ( !client ) + return NULL; - wxCHECK_MSG( nb_page, NULL, _T("wxNotebook::RemovePage: invalid page") ); - - wxNotebookPage *client = GetPage(page); gtk_widget_ref( client->m_widget ); gtk_widget_unrealize( client->m_widget ); gtk_widget_unparent( client->m_widget ); gtk_notebook_remove_page( GTK_NOTEBOOK(m_widget), page ); - m_pagesData.DeleteObject( nb_page ); + m_pagesData.DeleteObject(GetNotebookPage(page)); return client; } @@ -691,7 +686,7 @@ void wxNotebook::ApplyWidgetStyle() bool wxNotebook::IsOwnGtkWindow( GdkWindow *window ) { return ((m_widget->window == window) || - (GTK_NOTEBOOK(m_widget)->panel == window)); + (NOTEBOOK_PANEL(m_widget) == window)); } //-----------------------------------------------------------------------------