// are you trying to call SetSelection() from a notebook event handler?
// you shouldn't!
wxCHECK_RET( !notebook->m_inSwitchPage,
// are you trying to call SetSelection() from a notebook event handler?
// you shouldn't!
wxCHECK_RET( !notebook->m_inSwitchPage,
// make wxNotebook::GetSelection() return the correct (i.e. consistent
// with wxBookCtrlEvent::GetSelection()) value even though the page is
// not really changed in GTK+
// make wxNotebook::GetSelection() return the correct (i.e. consistent
// with wxBookCtrlEvent::GetSelection()) value even though the page is
// not really changed in GTK+
// make wxNotebook::GetSelection() return the correct (i.e. consistent
// with wxBookCtrlEvent::GetSelection()) value even though the page is
// not really changed in GTK+
// make wxNotebook::GetSelection() return the correct (i.e. consistent
// with wxBookCtrlEvent::GetSelection()) value even though the page is
// not really changed in GTK+
if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
{
int sel = notebook->GetSelection();
if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
{
int sel = notebook->GetSelection();
- wxConstCast(this, wxNotebook)->m_selection =
- g_list_index( nb_pages, cur );
+ const_cast<wxNotebook *>(this)->
+ SetSelection(g_list_index( nb_pages, cur ));
// gtk_notebook_set_current_page is supposed to emit the switch-page signal
// which should be caught by our gtk_notebook_page_change_callback which
// should have reset the flag to false, check it:
// gtk_notebook_set_current_page is supposed to emit the switch-page signal
// which should be caught by our gtk_notebook_page_change_callback which
// should have reset the flag to false, check it:
(flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent,
"internal error in selection events generation"
);
(flags & SetSelection_SendEvent) || !m_skipNextPageChangeEvent,
"internal error in selection events generation"
);
wxT("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( position <= GetPageCount(), FALSE,
wxT("Can't add a page whose parent is not the notebook!") );
wxCHECK_MSG( position <= GetPageCount(), FALSE,
// Hack Alert! (Part II): See above in wxInsertChildInNotebook callback
// why this has to be done. NOTE: using gtk_widget_unparent here does not
// Hack Alert! (Part II): See above in wxInsertChildInNotebook callback
// why this has to be done. NOTE: using gtk_widget_unparent here does not