- m_menuCount ++;
- wxMenu **new_menus = new wxMenu *[m_menuCount];
- wxString *new_titles = new wxString[m_menuCount];
- int i;
-
- for (i = 0; i < m_menuCount - 1; i++)
- {
- new_menus[i] = m_menus[i];
- m_menus[i] = NULL;
- new_titles[i] = m_titles[i];
- m_titles[i] = "";
+ if (!pullDown)
+ {
+ menu = XmCreatePopupMenu ((Widget) parent, "popup", args, 2);
+ XtAddCallback(menu,
+ XmNunmapCallback,
+ (XtCallbackProc)wxMenuPopdownCallback,
+ (XtPointer)this);
+ }
+ else
+ {
+ char mnem = wxFindMnemonic (title);
+ wxStripMenuCodes ((char*) (const char*) title, wxBuffer);
+
+ menu = XmCreatePulldownMenu ((Widget) parent, "pulldown", args, 2);
+
+ wxString title2(wxStripMenuCodes(title));
+ wxXmString label_str(title2);
+ buttonWidget = XtVaCreateManagedWidget(title2,
+#if wxUSE_GADGETS
+ xmCascadeButtonGadgetClass, (Widget) parent,
+#else
+ xmCascadeButtonWidgetClass, (Widget) parent,
+#endif
+ XmNlabelString, label_str(),
+ XmNsubMenuId, menu,
+ NULL);
+
+ if (mnem != 0)
+ XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);