1 # vim: foldmarker=<<<,>>>
10 variable update_interval 50
25 body tlc::Clock::constructor {args} { #<<<1
26 eval itk_initialize $args
28 label $w.time -textvariable [scope time]
29 label $w.day -textvariable [scope day]
30 label $w.date -textvariable [scope date]
33 $w.time 1,1 -width 55 \
34 $w.day 1,2 -width 65 \
36 table configure $w r1 c1 c2 c3 -resize none
42 body tlc::Clock::destructor {} { #<<<1
43 after cancel $afterid; set afterid ""
47 body tlc::Clock::update_disp {} { #<<<1
48 after cancel $afterid; set afterid ""
49 set afterid [after $update_interval [code $this update_disp]]
50 set now [clock seconds]
51 if {$now == $last} return
53 foreach {time day date} [clock format $now -format "%H:%M:%S %A %d/%m/%Y"] break