X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a06066343d670807825adcafebfa4fb8cfff5521..89e60357485b3da6e7ed7995fbcf8722d3df7ef4:/src/os2/frame.cpp diff --git a/src/os2/frame.cpp b/src/os2/frame.cpp index 0643f20c5b..f3c22d5db5 100644 --- a/src/os2/frame.cpp +++ b/src/os2/frame.cpp @@ -552,6 +552,9 @@ void wxFrame::SetMenuBar( wxMenuBar* pMenuBar ) { + ERRORID vError; + wxString sError; + if (!pMenuBar) { DetachMenuBar(); @@ -578,6 +581,22 @@ void wxFrame::SetMenuBar( return; } + // + // Set the parent and owner of the menubar to be the frame + // + if (!::WinSetParent(m_hMenu, GetHwnd(), FALSE)) + { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Error setting parent for submenu. Error: %s\n", sError); + } + + if (!::WinSetOwner(m_hMenu, GetHwnd())) + { + vError = ::WinGetLastError(vHabmain); + sError = wxPMErrorToStr(vError); + wxLogError("Error setting parent for submenu. Error: %s\n", sError); + } InternalSetMenuBar(); m_frameMenuBar = pMenuBar;