]> git.saurik.com Git - wxWidgets.git/blobdiff - src/gtk/mdi.cpp
wxUniv compilation fix
[wxWidgets.git] / src / gtk / mdi.cpp
index 99c278b2d53534c3830f47d8d1cb49b8ae095156..36b2f789f053a99f4c23fa9d9aaa2f4516512ea5 100644 (file)
@@ -170,17 +170,19 @@ void wxMDIParentFrame::OnInternalIdle()
 
         /* need to set the menubar of the child */
         wxMDIChildFrame *active_child_frame = GetActiveChild();
-        wxMenuBar *menu_bar = active_child_frame->m_menuBar;
-        if (menu_bar)
+        if (active_child_frame != NULL)
         {
-            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);
+            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;
     }