SelBoxResTest.src 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. XCOMM! CDE_INSTALLATION_TOP/bin/dtksh
  2. XCOMM $XConsortium: SelBoxResTest.src /main/3 1996/04/23 20:18:42 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 verifies that the selection box properly
  12. XCOMM interprets the 'childPlacement' resource. Using a timer, it will
  13. XCOMM set the resource to a particular value, verify it is correct, and
  14. XCOMM then repeat for the next setting.
  15. XCOMM
  16. Timeout3()
  17. {
  18. XtGetValues $SB childPlacement:CP
  19. echo ChildPlacement
  20. echo " Expected = PLACE_TOP"
  21. echo " Actual = " $CP
  22. }
  23. Timeout2()
  24. {
  25. XtGetValues $SB childPlacement:CP
  26. echo ChildPlacement
  27. echo " Expected = PLACE_BELOW_SELECTION"
  28. echo " Actual = " $CP
  29. XtSetValues $SB childPlacement:PLACE_TOP
  30. XtAddTimeOut ID 5000 "Timeout3"
  31. }
  32. Timeout1()
  33. {
  34. XtGetValues $SB childPlacement:CP
  35. echo ChildPlacement
  36. echo " Expected = PLACE_ABOVE_SELECTION"
  37. echo " Actual = " $CP
  38. XtSetValues $SB childPlacement:PLACE_BELOW_SELECTION
  39. XtAddTimeOut ID 5000 "Timeout2"
  40. }
  41. XCOMM ###################### Create the Main UI ###############################
  42. XtInitialize TOPLEVEL selectionBoxTest SelectionBoxTest "$0" "$@"
  43. XtCreateManagedWidget SB sb XmSelectionBox $TOPLEVEL \
  44. childPlacement:PLACE_ABOVE_SELECTION
  45. XtCreateManagedWidget SCALE scale XmScale $SB \
  46. orientation:HORIZONTAL
  47. XtRealizeWidget $TOPLEVEL
  48. XtAddTimeOut ID 5000 "Timeout1"
  49. XtMainLoop