1 /* $Id: test11.c,v 1.1 2000/11/24 13:46:44 amai Exp $ */
2 /* amai:
3 XmNap versions <= 0.1.19 crash due xms being NULL.
4 I didn't check any further, just assembled this test
5 which is hopefully equivalent to the problem with XmNAp ... */
6
7
8 #include <stdlib.h>
9 #include <stdio.h>
10 #include <Xm/Xm.h>
11 #include <Xm/SelectioB.h>
12
13
14 int
main(int argc,char ** argv)15 main(int argc, char **argv)
16 {
17 XtAppContext app;
18 Widget toplevel, box;
19 Arg a[10];
20 int n;
21 XmString xms;
22 String tmp;
23
24 toplevel = XtVaAppInitialize(&app, "listTest", NULL, 0,
25 &argc, argv, NULL, NULL);
26
27 n = 0;
28 box = XmCreateSelectionBox(toplevel, "Box", a, n);
29
30 XtManageChild(box);
31
32 XtRealizeWidget(toplevel);
33
34 XtVaGetValues(box, XmNapplyLabelString, &xms, NULL);
35
36 if (xms) {
37 /* XmStringGetLtoR(xms, XmFONTLIST_DEFAULT_TAG, &tmp);
38 fprintf(stdout, "xms!=%s\n", xms); */
39 fprintf(stdout, "xms!=NULL\n");
40 exit(0);
41 }
42 else {
43 fprintf(stdout, "xms=NULL\n");
44 exit(1);
45 }
46 }
47