+//-----------------------------------------------------------------------------
+// "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 );
+
+}
+
+//-----------------------------------------------------------------------------
+// "realize" from m_widget
+//-----------------------------------------------------------------------------
+
+/* GTK 1.2 up to version 1.2.5 is broken so that we have to call a queue_resize
+ here in order to take repositioning before showing to take effect. */
+
+static gint
+gtk_notebook_realized_callback( GtkWidget * WXUNUSED(widget), wxWindow *win )
+{
+ if (g_isIdle)
+ wxapp_install_idle_handler();
+
+ gtk_widget_queue_resize( win->m_widget );
+
+ return FALSE;
+}
+
+//-----------------------------------------------------------------------------
+// InsertChild callback for wxNotebook
+//-----------------------------------------------------------------------------
+
+static void wxInsertChildInNotebook( wxNotebook* WXUNUSED(parent), wxWindow* WXUNUSED(child) )
+{
+ /* we don't do anything here but pray */
+}
+