X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/03647350fc7cd141953c72e0284e928847d30f44..256e97fb7d55aba8fe10c4c375a0228cbbdb7d86:/src/gtk/mdi.cpp diff --git a/src/gtk/mdi.cpp b/src/gtk/mdi.cpp index 9778056ad3..1a3c3f570d 100644 --- a/src/gtk/mdi.cpp +++ b/src/gtk/mdi.cpp @@ -123,7 +123,7 @@ void wxMDIParentFrame::OnInternalIdle() wxMenuBar *menu_bar = active_child_frame->m_menuBar; if (menu_bar) { - menu_bar->SetInvokingWindow(active_child_frame); + menu_bar->Attach(active_child_frame); } } m_justInserted = false; @@ -149,7 +149,13 @@ void wxMDIParentFrame::OnInternalIdle() { if (menu_bar->Show(true)) { - menu_bar->SetInvokingWindow( child_frame ); + // 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; } @@ -157,7 +163,7 @@ void wxMDIParentFrame::OnInternalIdle() { if (menu_bar->Show(false)) { - menu_bar->UnsetInvokingWindow( child_frame ); + menu_bar->Detach(); } } } @@ -173,12 +179,12 @@ void wxMDIParentFrame::OnInternalIdle() if (visible_child_menu) { m_frameMenuBar->Show( false ); - m_frameMenuBar->UnsetInvokingWindow( this ); + m_frameMenuBar->Detach(); } else { m_frameMenuBar->Show( true ); - m_frameMenuBar->SetInvokingWindow( this ); + m_frameMenuBar->Attach( this ); } } }