1 XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
2 XCOMM $XConsortium: TextDisp1.src /main/3 1996/04/23 20:18:56 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 exercises the commands which enable and disable
15 XCOMM updating in a text widget. If the update is disabled, and the value of
16 XCOMM the text field is then changed, the text field will not update what is
17 XCOMM shown, until update is again enabled.
20 XCOMM Pushbutton Callback: enable update in the text widget
23 XmTextEnableRedisplay $TEXT
26 XCOMM Pushbutton Callback: disable update in the text widget
29 XmTextDisableRedisplay $TEXT
32 XCOMM Pushbutton Callback: changes the text value
35 XmTextSetString $TEXT "line A
44 XCOMM Pushbutton Callback: changes the text value
47 XmTextSetString $TEXT "line a
57 XCOMM ###################### Create the Main UI ###############################
59 XtInitialize TOPLEVEL textDisp1 TextDisp1 "$0" "$@"
60 XtSetValues $TOPLEVEL allowShellResize:True
62 XmCreateScrolledText TEXT $TOPLEVEL text \
65 editMode:MULTI_LINE_EDIT \
73 XtRealizeWidget $TOPLEVEL
75 XtCreateApplicationShell TOPLEVEL2 textDisp1a TopLevelShell
77 XtCreateManagedWidget RC rc XmRowColumn $TOPLEVEL2 \
78 orientation:HORIZONTAL \
82 XtCreateManagedWidget PB1 pb1 XmPushButton $RC \
83 labelString:"Disable Update"
84 XtAddCallback $PB1 activateCallback "DisableUpdate"
86 XtCreateManagedWidget PB2 pb2 XmPushButton $RC \
87 labelString:"Enable Update"
88 XtAddCallback $PB2 activateCallback "EnableUpdate"
90 XtCreateManagedWidget PB3 pb3 XmPushButton $RC \
91 labelString:"Change Value 1"
92 XtAddCallback $PB3 activateCallback "ChangeValue1"
94 XtCreateManagedWidget PB4 pb4 XmPushButton $RC \
95 labelString:"Change Value 2"
96 XtAddCallback $PB4 activateCallback "ChangeValue2"
98 XtRealizeWidget $TOPLEVEL2