Consistently set wxMenuBar parent in all ports.
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
This commit is contained in:
@@ -925,6 +925,7 @@ void wxMenuBarBase::Attach(wxFrame *frame)
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
|
wxASSERT_MSG( !IsAttached(), wxT("menubar already attached!") );
|
||||||
|
|
||||||
|
SetParent(frame);
|
||||||
m_menuBarFrame = frame;
|
m_menuBarFrame = frame;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -933,6 +934,7 @@ void wxMenuBarBase::Detach()
|
|||||||
wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
|
wxASSERT_MSG( IsAttached(), wxT("detaching unattached menubar") );
|
||||||
|
|
||||||
m_menuBarFrame = NULL;
|
m_menuBarFrame = NULL;
|
||||||
|
SetParent(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
|
@@ -304,7 +304,6 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
|
|||||||
hildon_window_set_menu(HILDON_WINDOW(m_widget),
|
hildon_window_set_menu(HILDON_WINDOW(m_widget),
|
||||||
GTK_MENU(m_frameMenuBar->m_widget));
|
GTK_MENU(m_frameMenuBar->m_widget));
|
||||||
#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
|
#else // !wxUSE_LIBHILDON && !wxUSE_LIBHILDON2
|
||||||
m_frameMenuBar->SetParent(this);
|
|
||||||
|
|
||||||
// menubar goes into top of vbox (m_mainWidget)
|
// menubar goes into top of vbox (m_mainWidget)
|
||||||
gtk_box_pack_start(
|
gtk_box_pack_start(
|
||||||
|
Reference in New Issue
Block a user