#include "wx/imaglist.h"
#include "wx/intl.h"
#include "wx/log.h"
+#include "wx/bitmap.h"
#include "wx/gtk/private.h"
#include "wx/gtk/win_gtk.h"
gint page,
wxNotebook *notebook )
{
- static bool s_inPageChange = FALSE;
-
// are you trying to call SetSelection() from a notebook event handler?
// you shouldn't!
- wxCHECK_RET( !s_inPageChange,
+ wxCHECK_RET( !notebook->m_inSwitchPage,
_T("gtk_notebook_page_change_callback reentered") );
- s_inPageChange = TRUE;
+ notebook->m_inSwitchPage = TRUE;
if (g_isIdle)
wxapp_install_idle_handler();
notebook->GetEventHandler()->ProcessEvent( eventChanged );
}
- s_inPageChange = FALSE;
+ notebook->m_inSwitchPage = FALSE;
}
//-----------------------------------------------------------------------------
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") );
void wxNotebook::Init()
{
m_padding = 0;
+ m_inSwitchPage = FALSE;
+
m_imageList = (wxImageList *) NULL;
m_pagesData.DeleteContents( TRUE );
m_selection = -1;
{
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();