]> git.saurik.com Git - wxWidgets.git/commitdiff
Consistently set wxMenuBar parent in all ports.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2013 23:59:37 +0000 (23:59 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 4 May 2013 23:59:37 +0000 (23:59 +0000)
Previously, wxGTK used the associated frame as wxMenuBar parent, while the
other ports did not. Do set the frame as menu bar parent in all ports now.

Of course, considering that wxMenuBar is not a window at all, this doesn't
necessarily make much sense, but at least it makes the behaviour consistent.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@73923 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/menucmn.cpp
src/gtk/frame.cpp

index 7230bb103ded730ff8a3b8b74b460b3e1cead896..dacfbf4d90a9ba68d7b2b8c42df8a7d08c676845 100644 (file)
@@ -925,6 +925,7 @@ void wxMenuBarBase::Attach(wxFrame *frame)
 {
     wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
 
+    SetParent(frame);
     m_menuBarFrame = frame;
 }
 
@@ -933,6 +934,7 @@ void wxMenuBarBase::Detach()
     wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
 
     m_menuBarFrame = NULL;
+    SetParent(NULL);
 }
 
 // ----------------------------------------------------------------------------
index 5c20c83f8511cea4f2e2e441a783325b1bfaa701..915b7a2dd2568105428e60002eb61cacbbbf5ad2 100644 (file)
@@ -304,7 +304,6 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
         hildon_window_set_menu(HILDON_WINDOW(m_widget),
                                GTK_MENU(m_frameMenuBar->m_widget));
 #else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
-        m_frameMenuBar->SetParent(this);
 
         // menubar goes into top of vbox (m_mainWidget)
         gtk_box_pack_start(