К строке меню можно прикрепить только CascadeButton или CascadeButtonGadget. Вы не можете поместить на него кнопку-переключатель. Вы можете создать PullDown и прикрепить к нему кнопку Toggle
#include <Xm/RowColumn.h>
#include <Xm/MainW.h>
#include <Xm/CascadeB.h>
#include <Xm/SeparatoG.h>
#include <Xm/PushBG.h>
#include <Xm/ToggleBG.h>
main(argc, argv)
int argc;
char *argv[];
{
Widget toplevel, MainWindow, menuBar, FilePullDown;
XmString label_str;
XtAppContext app;
XtSetLanguageProc (NULL, NULL, NULL);
toplevel = XtVaAppInitialize (&app, "Program", NULL, 0,
&argc, argv, NULL, NULL);
MainWindow = XtVaCreateManagedWidget ("mainWindow",
xmMainWindowWidgetClass, toplevel,
XmNscrollingPolicy, XmAUTOMATIC,
NULL);
menuBar = XmCreateMenuBar (MainWindow, "menuBar", NULL, 0);
FilePullDown = XmCreatePulldownMenu (menuBar, "Language", NULL, 0);
label_str = XmStringCreateLocalized ("Language or Exit");
XtVaCreateManagedWidget ("File",
xmCascadeButtonWidgetClass, menuBar,
XmNlabelString, label_str,
XmNmnemonic, 'F',
XmNsubMenuId, FilePullDown,
NULL);
XmStringFree (label_str);
/* Now add the menu items */
XtVaCreateManagedWidget ("Italian or French",
xmToggleButtonGadgetClass, FilePullDown, NULL);
XtVaCreateManagedWidget ("separator",
xmSeparatorGadgetClass, FilePullDown, NULL);
XtVaCreateManagedWidget ("Exit",
xmPushButtonGadgetClass, FilePullDown, NULL);
XtManageChild (menuBar);
XtRealizeWidget (toplevel);
XtAppMainLoop (app);
}