#!/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