-bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style )
-{
- m_needParent = TRUE;
-
- PreCreation( parent, -1, wxPoint(10,10), wxSize(100,100), style, "wxMDIClientWindow" );
-
- m_widget = gtk_notebook_new();
-
- gtk_signal_connect( GTK_OBJECT(m_widget), "switch_page",
- GTK_SIGNAL_FUNC(gtk_page_change_callback), (gpointer)this );
-
- gtk_notebook_set_scrollable( GTK_NOTEBOOK(m_widget), 1 );
-
- PostCreation();
-
- Show( TRUE );
-
- return TRUE;
-};
-
-void wxMDIClientWindow::AddChild( wxWindow *child )
-{
- if (!child->IsKindOf(CLASSINFO(wxMDIChildFrame)))
- {
- wxFAIL_MSG("wxNotebook::AddChild: Child has to be wxMDIChildFrame");
- return;
- };
-
- m_children.Append( child );
-
- wxString s;
- wxMDIChildFrame* mdi_child = (wxMDIChildFrame*) child;
- s = mdi_child->m_title;
- if (s.IsNull()) s = "MDI child";
-
- GtkWidget *label_widget;
- label_widget = gtk_label_new( s );
- gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 );
-
- gtk_signal_connect( GTK_OBJECT(child->m_widget), "size_allocate",
- GTK_SIGNAL_FUNC(gtk_page_size_callback), (gpointer)child );
-
- gtk_notebook_append_page( GTK_NOTEBOOK(m_widget), child->m_widget, label_widget );
-
- mdi_child->m_page = (GtkNotebookPage*) (g_list_last(GTK_NOTEBOOK(m_widget)->children)->data);
-
- gtk_notebook_set_page( GTK_NOTEBOOK(m_widget), m_children.Number()-1 );
-
- gtk_page_change_callback( NULL, mdi_child->m_page, 0, this );
-};
+ 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 );