- if (menu_bar->Show(TRUE))
- {
- menu_bar->m_width = m_width;
- menu_bar->m_height = wxMENU_HEIGHT;
- gtk_myfixed_set_size( GTK_MYFIXED(m_mainWidget),
- menu_bar->m_widget,
- 0, 0, m_width, wxMENU_HEIGHT );
- menu_bar->SetInvokingWindow( child_frame );
- }
- visible_child_menu = TRUE;
+ if (child_frame == active_child_frame)
+ {
+ if (menu_bar->Show(true))
+ {
+ 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 );
+
+ // Attach() asserts if we call it for an already
+ // attached menu bar so don't do it if we're already
+ // associated with this frame (it would be nice to get
+ // rid of this check and ensure that this doesn't
+ // happen...)
+ if ( menu_bar->GetFrame() != child_frame )
+ menu_bar->Attach( child_frame );
+ }
+ visible_child_menu = true;
+ }
+ else
+ {
+ if (menu_bar->Show(false))
+ {
+ menu_bar->Detach();
+ }
+ }