+// "switch_page"
+//-----------------------------------------------------------------------------
+
+static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
+ GtkNotebookPage *WXUNUSED(page),
+ gint nPage,
+ gpointer data)
+{
+ wxNotebook *notebook = (wxNotebook *)data;
+
+ int old = notebook->GetSelection();
+
+ // TODO: emulate PAGE_CHANGING event
+
+ wxNotebookEvent event( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
+ notebook->GetId(), nPage, old );
+ event.SetEventObject( notebook );
+ notebook->GetEventHandler()->ProcessEvent( event );
+}
+
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
+{
+ if ((win->m_x == alloc->x) &&
+ (win->m_y == alloc->y) &&
+ (win->m_width == alloc->width) &&
+ (win->m_height == alloc->height))
+ {
+ return;
+ }
+
+ win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height );
+
+ if (win->GetAutoLayout()) win->Layout();
+}
+
+//-----------------------------------------------------------------------------
+// "key_press_event"
+//-----------------------------------------------------------------------------
+
+static gint
+gtk_notebook_key_press_callback( GtkWidget *widget, GdkEventKey *gdk_event, wxNotebook *notebook )
+{
+ if (g_blockEventsOnDrag) return FALSE;
+
+ if (!notebook->HasVMT()) return FALSE;
+
+ 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;
+}
+