X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1631916e47c96992995966411ff982b160d74e04..7acf6a921e69c3382706c2cfc35e826d08004231:/src/gtk/mdi.cpp diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 131cee85cb..36b2f789f0 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -168,16 +168,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; }