* NAME wallclock - A clock widget, synchronized with system-clock * VERSION 1.0 * SYNOPSIS wallclock pathName ?options? * INTRODUCTION wallclock is a continuosly updated clock embedded in a label widget. Two commands (start/stop) and three options (-interval,-timeformat,-utc) have been added to the standard label-widget's options/commands. * WALLCLOCK OPTIONS All "label" options are supported, but the "-textvariable" options has been disabled. Specific options: -utc _boolean_ If _boolean_ is true, UTC (Universal Time) time is displayed. If _boolean_ is false, local time is displayed. Default is false (local time). -interval _string_ _interval_ is a specification of the update interval; it should be expressed as a "relative time" (see [clock] command). Example: "1 hour" "20 minutes" "2 minutes 30 seconds" Default is "1 sec" -timeformat _string_ _string_ is a pattern for formatting the current time value. See [clock format] command for full details Default is "%H:%M:%S" NOTE: these options will be applied after re-starting the wallclock. * WALLCLOCK COMMANDS pathName cget option Return the current value of the configuration option given by option. pathName configure ?option? ?value option value ...? Query or modify the configuration options of the widget pathName start Activate the wallclock (or re-start it) pathName stop Stop the wallclock pathName getClockStatus Return the clock's status: "on" (running) or "off" (stopped) * BINDINGS same as for the label widget * EXAMPLE * package require wallclock wallclock .wc1 -bg yellow wallclock .wc2 -bg green pack .wc1 .wc2 .wc1 start .wc2 start # after 10 sec, change the wc1 configuration after 10000 { .wc1 configure -interval "1 minute" -timeformat "%d%-%m-%y %H:%M" .wc1 start ;# re-start } # after 10 secs, destroy wc1 and deallocates the resources after 10000 destroy .wc1 DEPENDENCIES package snit is required package SyncTimer is required. TO DO use labelframe (or Paved::label) instead of label (trivial)