-static gint
-gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
-{
- if (g_blockEventsOnDrag) return FALSE;
-
- if (!notebook->HasVMT()) return FALSE;
-
- /* this code makes jumping down from the handles of the notebooks
- to the actual items in the visible notebook page possible with
- the down-arrow key */
-
- if (gdk_event->keyval != GDK_Down) return FALSE;
-
- if (notebook != notebook->FindFocus()) return FALSE;
-
- if (notebook->m_pages.GetCount() == 0) return FALSE;
-
- wxNode *node = notebook->m_pages.Nth( notebook->GetSelection() );
-
- if (!node) return FALSE;
-
- wxNotebookPage *page = (wxNotebookPage*) node->Data();
-
- // don't let others the key event
- gtk_signal_emit_stop_by_name( GTK_OBJECT(widget), "key_press_event" );
-
- page->m_client->SetFocus();
-
- return TRUE;
+ if (win->SendPageChangingEvent(page))
+ // allow change, unblock handler for changed event
+ g_signal_handlers_unblock_by_func(widget, (void*)switch_page_after, win);
+ else
+ // change vetoed, unblock handler to set selection back
+ g_signal_handlers_unblock_by_func(widget, (void*)event_after, win);
+}