1 /* $Header: /cvsroot/lesstif/lesstif/test/Xm/textf/test16.c,v 1.2 2002/06/04 16:22:07 dannybackx Exp $
2 
3    [ lesstif-Bugs-446600 ] XmTextFieldSetHighlight does not work...
4    Example more than one selection, as reported by Al Lykken.
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   XmTextFieldSetHighlight(one, 5, 7, XmHIGHLIGHT_SELECTED);
36 
37   XtRealizeWidget(toplevel);
38 
39   LessTifTestMainLoop(toplevel);
40 
41   exit(0);
42 }
43