summaryrefslogtreecommitdiffstats
path: root/tests/test_sig.tk
diff options
context:
space:
mode:
authorWilliam Joye <wjoye@cfa.harvard.edu>2019-01-02 19:05:44 (GMT)
committerWilliam Joye <wjoye@cfa.harvard.edu>2019-01-02 19:05:44 (GMT)
commitfe3a889e527a0369c6f7d42675f358815143a502 (patch)
tree75ee3b8feab73d5773e0994fd298288b81a73128 /tests/test_sig.tk
downloadblt-fe3a889e527a0369c6f7d42675f358815143a502.zip
blt-fe3a889e527a0369c6f7d42675f358815143a502.tar.gz
blt-fe3a889e527a0369c6f7d42675f358815143a502.tar.bz2
Squashed 'tclsignal/' content from commit 6189622d
git-subtree-dir: tclsignal git-subtree-split: 6189622d1687dbcdb9c26ab1f1a4003e24a6de87
Diffstat (limited to 'tests/test_sig.tk')
-rwxr-xr-xtests/test_sig.tk31
1 files changed, 31 insertions, 0 deletions
diff --git a/tests/test_sig.tk b/tests/test_sig.tk
new file mode 100755
index 0000000..feca784
--- /dev/null
+++ b/tests/test_sig.tk
@@ -0,0 +1,31 @@
+#!/usr/local/bin/wish4.1
+# ENSURE YOUR TCLLIBPATH includes /usr/local/lib/signal!
+# (or uncomment the appropriate load line and comment the package line)
+# --SUN
+# load /usr/local/lib/signal_ext.so
+# --HP
+# load /usr/local/lib/signal_ext.sl
+package require Signal
+
+signal add 21 { wm iconify . ; wm deiconify . }
+signal add SIGHUP { puts "Signal 1 received" }
+signal add SIGINT { puts "SIGINT received" }
+
+puts "Showing all the signals handled"
+puts [signal print]
+puts "Showing how 3 is handled"
+puts [signal print 3]
+puts "Showing how SIGTTOU is handled"
+puts [signal print SIGTTOU]
+
+frame .bottom
+button .bottom.b -text "Done" -command "exit 0"
+button .bottom.i -text "Iconify" -command "wm iconify ."
+label .l -wraplength 40m -text {
+Sending this process signals 1 (HUP) or 2 (^C or INT) will print messages; signal 21 (URG) will pop it up!
+}
+
+pack .bottom.b -side left -fill x
+pack .bottom.i -side right -fill x
+pack .l -side top -fill both -expand true
+pack .bottom -in . -side bottom -fill x