X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1631916e47c96992995966411ff982b160d74e04..ba75c6bb8c85705aca6b46871e0fc6548f15a73d:/src/gtk1/mdi.cpp diff --git a/src/gtk1/mdi.cpp b/src/gtk1/mdi.cpp index 131cee85cb..ddd65e82be 100644 --- a/src/gtk1/mdi.cpp +++ b/src/gtk1/mdi.cpp @@ -52,6 +52,7 @@ extern wxList wxPendingDelete; // "switch_page" //----------------------------------------------------------------------------- +extern "C" { static void gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), GtkNotebookPage *page, @@ -104,6 +105,7 @@ gtk_mdi_page_change_callback( GtkNotebook *WXUNUSED(widget), event2.SetEventObject( child); child->GetEventHandler()->ProcessEvent( event2 ); } +} //----------------------------------------------------------------------------- // wxMDIParentFrame @@ -168,16 +170,21 @@ void wxMDIParentFrame::OnInternalIdle() GtkNotebook *notebook = GTK_NOTEBOOK(m_clientWindow->m_widget); gtk_notebook_set_page( notebook, g_list_length( notebook->children ) - 1 ); - /* need to set the menubar of the child */ + /* need to set the menubar of the child */ wxMDIChildFrame *active_child_frame = GetActiveChild(); - wxMenuBar *menu_bar = active_child_frame->m_menuBar; - menu_bar->m_width = m_width; - menu_bar->m_height = wxMENU_HEIGHT; - gtk_pizza_set_size( GTK_PIZZA(m_mainWidget), - menu_bar->m_widget, - 0, 0, m_width, wxMENU_HEIGHT ); - menu_bar->SetInvokingWindow(active_child_frame); - + if (active_child_frame != NULL) + { + wxMenuBar *menu_bar = active_child_frame->m_menuBar; + if (menu_bar) + { + menu_bar->m_width = m_width; + menu_bar->m_height = wxMENU_HEIGHT; + gtk_pizza_set_size( GTK_PIZZA(m_mainWidget), + menu_bar->m_widget, + 0, 0, m_width, wxMENU_HEIGHT ); + menu_bar->SetInvokingWindow(active_child_frame); + } + } m_justInserted = false; return; } @@ -430,6 +437,7 @@ void wxMDIChildFrame::SetTitle( const wxString &title ) // "size_allocate" //----------------------------------------------------------------------------- +extern "C" { static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* alloc, wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -445,6 +453,7 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation* win->SetSize( alloc->x, alloc->y, alloc->width, alloc->height ); } +} //----------------------------------------------------------------------------- // InsertChild callback for wxMDIClientWindow