blob: b06f173eeeb1eae3ab7118268da2e57b9148b138 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
|
#!/usr/bin/env ruby
# frozen_string_literal: false
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
|