WorkProcTest1.src 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
  2. XCOMM $XConsortium: WorkProcTest1.src /main/3 1996/04/23 20:19:16 drk $
  3. XCOMM #########################################################################
  4. XCOMM (c) Copyright 1993, 1994 Hewlett-Packard Company
  5. XCOMM (c) Copyright 1993, 1994 International Business Machines Corp.
  6. XCOMM (c) Copyright 1993, 1994 Sun Microsystems, Inc.
  7. XCOMM (c) Copyright 1993, 1994 Unix System Labs, Inc., a subsidiary of
  8. XCOMM Novell, Inc.
  9. XCOMM #########################################################################
  10. XCOMM
  11. XCOMM This sample shell script demonstrates the usage of an Xt workproc
  12. XCOMM
  13. integer count=5
  14. XCOMM The work proc will be called five time, at which point it will return
  15. XCOMM '1', which will cause it to be automatically unregistered.
  16. function WorkProc1
  17. {
  18. count=$count-1
  19. echo "WorkProc1 ("$count")"
  20. if [ "$count" -eq 0 ]
  21. then
  22. return 1
  23. else
  24. return 0
  25. fi
  26. }
  27. XCOMM ###################### Create the Main UI ###############################
  28. XtInitialize TOPLEVEL workProcTest1 WorkProcTest1 "$0" "$@"
  29. XtAddWorkProc ID1 "WorkProc1"
  30. XtMainLoop