home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / doc / examples / dialog.tcl < prev    next >
Encoding:
Text File  |  1995-06-29  |  507 b   |  31 lines

  1. #! moat
  2.  
  3. xtAppInitialize
  4.  
  5. xmLabel .dummy managed \
  6.     -labelString "Hit <Enter> to pop up dialog"
  7.  
  8. xmErrorDialog .error
  9. .error.Cancel unmanageChild
  10. .error.Help   unmanageChild
  11. .error.OK activateCallback {
  12.     .error unmanageChild
  13. }
  14.  
  15. proc popup {why} {
  16.     .error setValues \
  17.         -messageString "Error:\n$why" \
  18.         -defaultPosition False \
  19.         -x 13 -y 42
  20.     .error manageChild
  21. }
  22.  
  23. # Start this thing each time <Enter> is hit.
  24. . addInput stdin r {
  25.     read stdin 1
  26.     popup "Unwanted input dropped"
  27. }
  28.  
  29. . realizeWidget
  30. . mainLoop
  31.