1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/textf/test13.c,v 1.2 2001/08/01 13:55:31 amai Exp $
2 
3    [ lesstif-Bugs-446600 ] XmTextFieldSetHighlight does not work...
4    Example for XmHIGHLIGHT_SELECTED.
5 
6 */
7 
8 
9 #include <stdlib.h>
10 
11 #include <Xm/Xm.h>
12 #include <Xm/TextF.h>
13 
14 
15 int
main(int argc,char * argv[])16 main(int argc, char *argv[])
17 {
18   Widget toplevel, one;
19   XtAppContext app;
20   char *text="This is a stupid text.";
21 
22 
23   toplevel = XtVaAppInitialize(&app, "Label",
24                                NULL, 0,
25                                &argc, argv,
26                                NULL, NULL);
27 
28   one = XtVaCreateManagedWidget("one", xmTextFieldWidgetClass, toplevel,
29                                 XmNcolumns, 30,
30                                 NULL);
31 
32   XmTextFieldSetString(one, text);
33 
34   XmTextFieldSetHighlight(one, 10, 16, XmHIGHLIGHT_SELECTED);
35 
36   XtRealizeWidget(toplevel);
37 
38   LessTifTestMainLoop(toplevel);
39 
40   exit(0);
41 }
42