]> git.saurik.com Git - wxWidgets.git/blobdiff - src/os2/frame.cpp
more tests: OS/user info functions
[wxWidgets.git] / src / os2 / frame.cpp
index 0643f20c5bd8202de70e729fff0191030653b0c6..f3c22d5db5d40bf5d8bd79aa50fdb6a9240a6fa2 100644 (file)
@@ -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;