convert all Imakefile LinuxDistribution to LinuxArchitecture.
[oweals/cde.git] / cde / programs / dtksh / examples / WorkProcTest1.src
1 XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
2 XCOMM  $XConsortium: WorkProcTest1.src /main/3 1996/04/23 20:19:16 drk $
3
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
9 XCOMM       Novell, Inc.
10 XCOMM #########################################################################
11
12
13 XCOMM 
14 XCOMM  This sample shell script demonstrates the usage of an Xt workproc
15 XCOMM 
16
17 integer count=5
18
19 XCOMM  The work proc will be called five time, at which point it will return
20 XCOMM  '1', which will cause it to be automatically unregistered.
21 function WorkProc1
22 {
23    count=$count-1
24    echo "WorkProc1 ("$count")"
25    if [ "$count" -eq 0 ] 
26    then
27       return 1
28    else
29       return 0
30    fi
31 }
32
33
34 XCOMM ###################### Create the Main UI ###############################
35
36 XtInitialize TOPLEVEL workProcTest1 WorkProcTest1 "$0" "$@"
37
38 XtAddWorkProc ID1 "WorkProc1"
39
40 XtMainLoop