Sophie

Sophie

distrib > Scientific%20Linux > 5x > x86_64 > media > main > by-pkgid > e2a5fef11a7f55d2dc803b8b7498c8e5 > files > 704

ruby-tcltk-1.8.5-31.el5_9.x86_64.rpm

#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

Thread.new{
  trap('INT') {puts 'catch SIGINT'}
  sleep 5
  trap('INT', 'DEFAULT')
}

Tk::Iwidgets::Watch.new(:state=>:disabled, :showampm=>:no, 
                        :width=>155, :height=>155){|w|
  w.pack(:padx=>10, :pady=>10, :fill=>:both, :expand=>true)
  # TkTimer.new(1000, -1, proc{w.show; Tk.update}).start
  TkTimer.new(25, -1, proc{w.show; Tk.update}).start
}

Tk.mainloop