int main(int argc, char **argv) { Widget toplevel, widget, bb, list; XtAppContext app; XmString item; Arg args[10]; int n = 0; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app, "ComBox", NULL, 0, &argc, argv, NULL, NULL); bb = XmCreateForm(toplevel, "bb", NULL, 0); XtManageChild(bb); widget = XmCreateDropDownComboBox(bb, "combo", args, n); XtVaSetValues(widget, XmNtopAttachment, XmATTACH_FORM, XmNbottomAttachment, XmATTACH_FORM, XmNleftAttachment, XmATTACH_FORM, XmNrightAttachment, XmATTACH_FORM, NULL); /* use list routine to add items */ list = CB_List(widget); item = XmStringCreateSimple("Item 1"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 2"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 3"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 4"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 5"); XmListAddItem(list,item,0); XmComboBoxUpdate(widget); XtManageChild(widget); XtRealizeWidget(toplevel); #if 0 XdbPrintResources(CB_ListShell(widget)); XdbPrintResources(widget); #endif check_geometry(widget); LessTifTestMainLoop(toplevel); exit(0); }
Widget XmCreateDropDownComboBox_TNK(Widget parent, String name, ArgList arglist,Cardinal argcount) { return XmCreateDropDownComboBox(parent, name, arglist, argcount);}
int main(int argc, char **argv) { Widget toplevel, widget, bb, list; XtAppContext app; XmString item; Arg args[10]; int n = 0; XtSetLanguageProc(NULL, NULL, NULL); toplevel = XtVaAppInitialize(&app, "ComBox", NULL, 0, &argc, argv, NULL, NULL); bb = XmCreateBulletinBoard(toplevel, "bb", NULL, 0); XtManageChild(bb); widget = XmCreateDropDownComboBox(bb, "combo", args, n); #if 0 /* causes a core dump and reports a warning */ XtDestroyWidget(CB_EditBox(widget)); /* causes a core dump */ XtDestroyWidget(CB_List(widget)); /* reports warning if list or edit box are unmanaged */ XtUnmanageChild(CB_List(widget)); XtUnmanageChild(CB_EditBox(widget)); /* does not report warning if scrolled window is unmanaged */ XtUnmanageChild(CB_ScrolledW(widget)); #endif /* use list routine to add items */ list = CB_List(widget); item = XmStringCreateSimple("Item 1"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 2"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 3"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 4"); XmListAddItem(list,item,0); item = XmStringCreateSimple("Item 5"); XmListAddItem(list,item,0); XmComboBoxUpdate(widget); XtManageChild(widget); XtRealizeWidget(toplevel); #if 1 XdbPrintResources(CB_ListShell(widget)); XdbPrintResources(widget); #endif check_geometry(widget); LessTifTestMainLoop(toplevel); exit(0); }