1#!/usr/bin/env ruby 2require 'tk' 3require 'tkextlib/iwidgets' 4 5Thread.new{ 6 trap('INT') {puts 'catch SIGINT'} 7 sleep 5 8 trap('INT', 'DEFAULT') 9} 10 11Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no, 12 :width=>155, :height=>155){|w| 13 w.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true) 14 # TkTimer.new(1000, -1, proc{w.show; Tk.update}).start 15 TkTimer.new(25, -1, proc{w.show; Tk.update}).start 16} 17 18Tk.mainloop 19