Wallclock

ABU 7-feb-2012

WallClock 2.0 A clock widget, synchronized with system-clock.

Wallclock is a continuosly updated clock embedded in a label widget. Two commands (start/stop) and three options (-interval,-timeformat,-timezone) have been added to the standard label-widget's options/commands.

See demo and documentation within the package.

This package requires SyncTimer


Here is a sample : 4-clocks of different time-zones

Image 4clocks


package require wallclock

set CaptionTimezone {
    "local time"   :localtime
    "UTC"          UTC  
    "Mombasa"      Africa/Nairobi
    "Caracas"      America/Caracas
}
    
foreach w { .lf1 .lf2 .lf3 .lf4 } {caption tz} $CaptionTimezone {
    labelframe $w -text $caption
    wallclock $w.wc -timezone $tz
    pack $w.wc
    $w.wc start
}
grid .lf1 .lf2 -padx 10 -pady 10 -sticky ew
grid .lf3 .lf4 -padx 10 -pady 10 -sticky ew

 # --- style touch ------------------------------------------
foreach w { .lf1 .lf2 .lf3 .lf4 } {
    $w.wc configure -relief ridge -bd 3 -padx 20 -pady 10
}
.lf1.wc configure -bg red
.lf2.wc configure -bg green
.lf3.wc configure -bg yellow
.lf4.wc configure -bg black    -foreground gray75

.lf1.wc configure -bg red      -font {Mathematica7 20}
.lf2.wc configure -bg green    -font {{SF Chromium 24} 20}
.lf3.wc configure -bg yellow   -font {{SF Zimmerman} 20}
.lf4.wc configure -bg black    -foreground gray50 -font {{SF Zero Gravity Condensed} 20}