- // don't let others the key event
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
+ /* win is a control: tab can be propagated up */
+ if ((gdk_event->keyval == GDK_Tab) || (gdk_event->keyval == GDK_ISO_Left_Tab))
+ {
+ wxNode *node = win->m_pages.Nth( win->GetSelection() );
+ if (!node) return FALSE;
+
+ wxGtkNotebookPage *page = (wxGtkNotebookPage*) node->Data();
+
+ wxNavigationKeyEvent event;
+ event.SetEventObject( win );
+ /* GDK reports GDK_ISO_Left_Tab for SHIFT-TAB */
+ event.SetDirection( (gdk_event->keyval == GDK_Tab) );
+ /* CTRL-TAB changes the (parent) window, i.e. switch notebook page */
+ event.SetWindowChange( (gdk_event->state & GDK_CONTROL_MASK) );
+ event.SetCurrentFocus( win );
+ if (!page->m_client->GetEventHandler()->ProcessEvent( event ))
+ {
+ page->m_client->SetFocus();
+ }