我正在开发一个应该翻译用户输入的项目,但这不是问题。事实上,我是 libmotif 的新手,我想要一个切换按钮来选择翻译方式(法语到意大利语或意大利语到法语)。因此,我在这个菜单栏上已经有一个级联按钮,我收到了这个警告:警告:名称:main_list 类:XmRowColumn Attempt to add wrong child type to a homogeneous RowColumn widget
警告:在 XtAddCallback 中找不到回调列表
此外,我可以将切换按钮放在其他功能的参数中以查看他的状态吗?
//Création de la fenêtre principal
Widget main_window = XtVaCreateManagedWidget("main_window", xmMainWindowWidgetClass, top_widget, NULL) ;
//Menu
Widget menu_bar = XmCreateMenuBar(main_window, (String) "main_list", NULL, 0);
XtManageChild(menu_bar);
Widget quit = XtVaCreateManagedWidget("Quit", xmCascadeButtonWidgetClass, menu_bar,NULL);
Widget toggle = XtVaCreateManagedWidget("Fr vers It", xmToggleButtonWidgetClass, menu_bar, NULL);
//Callbacks
XtAddCallback(quit, XmNactivateCallback, quit_call, NULL);
XtAddCallback(toggle,XmNactivateCallback, toggle_call, NULL);