X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6e42617af493da590f7d08ed248be615ab817eee..357d2b88cb15fa0ad97b1676fdbc88c2abc85451:/src/gtk/mdi.cpp?ds=inline diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 4a7ddf7c9f..f3f027e03e 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -402,11 +402,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title ) gtk_notebook_set_tab_label_text(notebook, m_widget, wxGTK_CONV( title ) ); } -//----------------------------------------------------------------------------- -// InsertChild callback for wxMDIClientWindow -//----------------------------------------------------------------------------- - -static void wxInsertChildInMDI(wxWindow* parent, wxWindow* child) +void wxMDIClientWindow::AddChildGTK(wxWindowGTK* child) { wxMDIChildFrame* child_frame = wx_static_cast(wxMDIChildFrame*, child); wxString s = child_frame->GetTitle(); @@ -415,13 +411,13 @@ static void wxInsertChildInMDI(wxWindow* parent, wxWindow* child) GtkWidget *label_widget = gtk_label_new( s.mbc_str() ); gtk_misc_set_alignment( GTK_MISC(label_widget), 0.0, 0.5 ); - GtkNotebook *notebook = GTK_NOTEBOOK(parent->m_widget); + GtkNotebook* notebook = GTK_NOTEBOOK(m_widget); gtk_notebook_append_page( notebook, child->m_widget, label_widget ); child_frame->m_page = (GtkNotebookPage*) (g_list_last(notebook->children)->data); - wxMDIParentFrame *parent_frame = wx_static_cast(wxMDIParentFrame*, parent->GetParent()); + wxMDIParentFrame* parent_frame = wx_static_cast(wxMDIParentFrame*, GetParent()); parent_frame->m_justInserted = true; } @@ -447,8 +443,6 @@ wxMDIClientWindow::~wxMDIClientWindow() bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) { - m_insertCallback = wxInsertChildInMDI; - if (!PreCreation( parent, wxDefaultPosition, wxDefaultSize ) || !CreateBase( parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style, wxDefaultValidator, wxT("wxMDIClientWindow") )) { @@ -457,6 +451,7 @@ bool wxMDIClientWindow::CreateClient( wxMDIParentFrame *parent, long style ) } m_widget = gtk_notebook_new(); + g_object_ref(m_widget); g_signal_connect (m_widget, "switch_page", G_CALLBACK (gtk_mdi_page_change_callback), parent);