]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/mdi.cpp
basic support for encodings for wxMSW::wxFont
[wxWidgets.git] / src / gtk / mdi.cpp
index 0b98599d59e20200bcb05c71852cb303986a2af3..ab91caff859f8bd1dcbfc31000c1cd367dd817df 100644 (file)
@@ -43,6 +43,27 @@ extern bool g_isIdle;
 
 extern wxList wxPendingDelete;
 
+//-----------------------------------------------------------------------------
+// "switch_page"
+//-----------------------------------------------------------------------------
+
+static void gtk_mdi_page_change_callback(GtkNotebook *WXUNUSED(widget),
+                                              GtkNotebookPage *WXUNUSED(page),
+                                              gint page,
+                                              wxMDIParentFrame *parent )
+{
+    if (g_isIdle) 
+        wxapp_install_idle_handler();
+
+    wxMDIChildFrame *child = parent->GetActiveChild();
+    
+    if (!child) return;
+
+    wxActivateEvent event( wxEVT_ACTIVATE, TRUE, child->GetId() );
+    event.SetEventObject( child);
+    child->GetEventHandler()->ProcessEvent( event );
+}
+
 //-----------------------------------------------------------------------------
 // wxMDIParentFrame
 //-----------------------------------------------------------------------------
@@ -418,6 +439,9 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
 
     m_widget = gtk_notebook_new();
 
+    gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
+      GTK_SIGNAL_FUNC(gtk_mdi_page_change_callback), (gpointer)parent );
+
     gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
 
     m_parent->DoAddChild( this );