- Widget menu = (Widget) 0;
- Widget buttonWidget = (Widget) 0;
- Arg args[5];
- XtSetArg (args[0], XmNnumColumns, m_numColumns);
- XtSetArg (args[1], XmNpacking, XmPACK_COLUMN);
-
- 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);
-
- XmString label_str = XmStringCreateSimple (wxBuffer);
- buttonWidget = XtVaCreateManagedWidget (wxBuffer,
-#if USE_GADGETS
- xmCascadeButtonGadgetClass, (Widget) parent,
-#else
- xmCascadeButtonWidgetClass, (Widget) parent,
-#endif
- XmNlabelString, label_str,
- XmNsubMenuId, menu,
- NULL);
-
- if (mnem != 0)
- XtVaSetValues (buttonWidget, XmNmnemonic, mnem, NULL);
-
- XmStringFree (label_str);
- }
-
- m_menuWidget = (WXWidget) menu;