+//-----------------------------------------------------------------------------
+// "switch_page"
+//-----------------------------------------------------------------------------
+
+static void gtk_notebook_page_change_callback(GtkNotebook *WXUNUSED(widget),
+                                              GtkNotebookPage *WXUNUSED(page),
+                                              gint page,
+                                              wxNotebook *notebook )
+{
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
+
+    int old = notebook->GetSelection();
+
+    wxNotebookEvent event1( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING,
+                            notebook->GetId(), page, old );
+    event1.SetEventObject( notebook );
+    
+    if ((notebook->GetEventHandler()->ProcessEvent( event1 )) &&
+        !event1.IsAllowed() )
+    {
+        /* program doesn't allow the page change */
+        gtk_signal_emit_stop_by_name( GTK_OBJECT(notebook->m_widget), "switch_page" );
+        return;
+    }
+
+    wxNotebookEvent event2( wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED,
+                            notebook->GetId(), page, old );
+    event2.SetEventObject( notebook );
+    notebook->GetEventHandler()->ProcessEvent( event2 );
+}
+
+//-----------------------------------------------------------------------------
+// "size_allocate"
+//-----------------------------------------------------------------------------
+
+static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win )
+{
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
+    
+    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_isIdle) wxapp_install_idle_handler();
+
+    if (g_blockEventsOnDrag) return FALSE;
+
+    if (!notebook->m_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;
+}
+
+//-----------------------------------------------------------------------------
+// InsertChild callback for wxNotebook
+//-----------------------------------------------------------------------------
+
+static void wxInsertChildInNotebook( wxNotebook* WXUNUSED(parent), wxWindow* WXUNUSED(child) )
+{
+    /* we don't do anything here but pray */
+}
+