1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/xmstring/test4.c,v 1.3 2002/04/17 16:32:01 amai Exp $ */
2 
3 #include <stdlib.h>
4 
5 #include <Xm/Xm.h>
6 #include <Xm/Label.h>
7 
8 /*
9    This tests behavior pointed out by Scott Cramer
10 
11    if the tag given XmStringCreate is invalid, Motif1.2
12    uses the font associated with XmFONTLIST_DEFAULT_TAG.
13 */
14 
15 int
main(int argc,char ** argv)16 main(int argc,
17      char **argv)
18 {
19     Widget toplevel, label;
20     XtAppContext app;
21     XmString xmstr;
22 
23     toplevel = XtVaAppInitialize(&app, "XmString", NULL, 0, &argc, argv, NULL, NULL);
24 
25     label = XmCreateLabel(toplevel,
26 			  "label",
27 			  NULL, 0);
28 
29     XtManageChild(label);
30 
31     xmstr = XmStringCreate("Hello World", "INVALID_FONT_LIST_TAG");
32 
33     XtVaSetValues(label,
34 		  XmNlabelString, xmstr,
35 		  NULL);
36 
37     /* free the storage from the XmString */
38     XmStringFree(xmstr);
39 
40     XtRealizeWidget(toplevel);
41 
42 {
43     static XtWidgetGeometry Expected[] = {
44    CWWidth | CWHeight            ,   50,   50,   70,   17, 0,0,0, /* label */
45     };
46     PrintDetails(    toplevel ,Expected);
47 };
48    LessTifTestMainLoop(    toplevel );
49     exit(0);
50 }
51