1 XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
2 XCOMM $XConsortium: TextFXYPos1.src /main/3 1996/04/23 20:19:01 drk $
4 XCOMM #########################################################################
5 XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
6 XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
7 XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
8 XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
10 XCOMM #########################################################################
14 XCOMM This sample shell script verifies that the XmTextFieldPosToXY command
15 XCOMM functions correctly.
18 XCOMM Pushbutton Callback: exercise the Text functions
21 XCOMM This position should not be visible
22 if XmTextFieldPosToXY $TEXT 90 X Y; then
23 echo "Text position 90 is at point ("$X","$Y")"
25 echo "Text position 90 is not currently visible"
28 XCOMM This position should be visible
29 if XmTextFieldPosToXY $TEXT 3 X Y; then
30 echo "Text position 3 is at point ("$X","$Y")"
32 echo "Text position 3 is not currently visible"
35 XmTextFieldXYToPos POS $TEXT $X $Y
36 echo "At point ("$X","$Y") is character position "$POS
40 XCOMM ###################### Create the Main UI ###############################
42 XtInitialize TOPLEVEL textFXYPos1 TextFXYPos1 "$0" "$@"
43 XtSetValues $TOPLEVEL allowShellResize:True
45 XmCreateTextField TEXT $TOPLEVEL text \
47 value:"line 1 line 2 line 3 line 4 line 5 line 6 line 7 line 8"
50 XtRealizeWidget $TOPLEVEL
52 XtCreateApplicationShell TOPLEVEL2 textFXYPos1a TopLevelShell
54 XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
55 orientation:HORIZONTAL \
59 XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
60 labelString:"Run XY Position Tests"
61 XtAddCallback $PB1 activateCallback "RunTests"
63 XtRealizeWidget $TOPLEVEL2