-
- SetBackgroundColour(m_backgroundColour);
- SetForegroundColour(m_foregroundColour);
- SetFont(m_font);
-
- XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
- XtRealizeWidget ((Widget) menuBarW);
- XtManageChild ((Widget) menuBarW);
- SetMenuBarFrame(parent);
-
- return TRUE;
+
+ Widget menuBarW = XmCreateMenuBar ((Widget) parent->GetMainWindowWidget(), "MenuBar", NULL, 0);
+ m_mainWidget = (WXWidget) menuBarW;
+
+ int i;
+ for (i = 0; i < GetMenuCount(); i++)
+ {
+ wxMenu *menu = GetMenu(i);
+ wxString title(m_titles[i]);
+ menu->SetButtonWidget(menu->CreateMenu (this, menuBarW, menu, title, TRUE));
+
+ /*
+ * COMMENT THIS OUT IF YOU DON'T LIKE A RIGHT-JUSTIFIED HELP MENU
+ */
+ wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
+
+ if (strcmp (wxBuffer, "Help") == 0)
+ XtVaSetValues ((Widget) menuBarW, XmNmenuHelpWidget, (Widget) menu->GetButtonWidget(), NULL);
+ }
+
+ SetBackgroundColour(m_backgroundColour);
+ SetForegroundColour(m_foregroundColour);
+ SetFont(m_font);
+
+ XtVaSetValues((Widget) parent->GetMainWindowWidget(), XmNmenuBar, (Widget) m_mainWidget, NULL);
+ XtRealizeWidget ((Widget) menuBarW);
+ XtManageChild ((Widget) menuBarW);
+ SetMenuBarFrame(parent);
+
+ return TRUE;