Don't use invoking window in wxGTK wxMenuBar implementation.

wxGTK wxMenuBar used its own SetInvokingWindow/UnsetInvokingWindow() and
related functions instead of reusing the base class Attach/Detach() which
exist for exactly the same purpose. This resulted in unnecessary code
duplication and confusion and, since the changes of r64104, resulted in
asserts due to use of SetInvokingWindow() for non-popup menus.

Fix this by removing the wxGTK-specific functions and doing the work they used
to do in (now overridden) Attach() and Detach(). Also call Attach/Detach()
instead of these functions from wxGTK wxFrame and wxMDIParentFrame code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64127 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2010-04-24 15:08:00 +00:00
parent 7739f9c947
commit 6abf7b639c
4 changed files with 51 additions and 64 deletions

View File

@@ -281,8 +281,6 @@ void wxFrame::DetachMenuBar()
#if wxUSE_LIBHILDON || wxUSE_LIBHILDON2
hildon_window_set_menu(HILDON_WINDOW(m_widget), NULL);
#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
m_frameMenuBar->UnsetInvokingWindow( this );
gtk_widget_ref( m_frameMenuBar->m_widget );
gtk_container_remove( GTK_CONTAINER(m_mainWidget), m_frameMenuBar->m_widget );
@@ -305,8 +303,6 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
hildon_window_set_menu(HILDON_WINDOW(m_widget),
GTK_MENU(m_frameMenuBar->m_menubar));
#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
m_frameMenuBar->SetInvokingWindow( this );
m_frameMenuBar->SetParent(this);
// menubar goes into top of vbox (m_mainWidget)