Re: FVWM: time.tcl

From: Richard Lister <ric_at_giccs.georgetown.edu>
Date: Mon, 06 Oct 1997 10:27:01 -0400

On Sat, 04 Oct 1997 13:43:53 +0200
Adam Kopacz <Adam.Kopacz_at_rhein-neckar.netsurf.de>
wrote concerning 'FVWM: time.tcl':
> hi,
>
> some months ago i have posted a time wish script taht looks great in
> FvwmButtons in this mailing list.. but now i have deleted it and need it
> :( i can't find it on the www-site/mailing list archive :(((
> did somebody has the script and could send it o me ???


Here you go. From deep in the Gb's of random stuff on my hard disk :-)

Ric



#! /bin/sh
# tcl/tk time/date script by Adam Kopacz [klo_at_writeme.com]
# *-tcl-* \
exec wish "$0" "$_at_"

proc update_digital_time {} {
    global digitalClockFormat digitalClockFrame

    $digitalClockFrame configure -text [clock format [clock seconds] -format $digitalClockFormat]
    .lab2 configure -text [clock format [clock seconds] -format "%d.%m.1997"]

}

proc update_digital_time_and_repeat {} {
    update_digital_time
    after [expr {60 - ([clock seconds] % 60)}]000 update_digital_time_and_repeat
}

proc set_digital_format {format} {
    global digitalClockFormat currentFormatNumber nFormats

    set nFormats 2

    case $format {
        0 {set digitalClockFormat "%I:%M %p"}
        1 {set digitalClockFormat "%H:%M"}
    }

    set currentFormatNumber $format
}

proc next_format {} {
    global currentFormatNumber nFormats

    incr currentFormatNumber
    if {$currentFormatNumber >= $nFormats} {
        set currentFormatNumber 0
    }
    set_digital_format $currentFormatNumber
    update_digital_time
}

proc digital_clock {nframe} {
    global digitalClockFrame

    set digitalClockFrame $nframe
    button $nframe -font "-adobe-helvetica-normal-r-*-*-11-*-*-*-*-*-*-" -command next_format -background #908090 -foreground #000040 -pady 2m -activebackground #909090
    label .lab2 -text "xx.xx.xx" -bg #908090 -font "-adobe-helvetica-normal-r-*-*-10-*-*-*-*-*-*-*"

    update_digital_time_and_repeat
    return
}

set_digital_format 1

proc doit {} {

    . configure -background #908090
    digital_clock .dclock
    pack .dclock -pady 1m -padx 1m -fill both -expand yes
    pack .lab2 -anchor c -fill both -expand yes
}

if !$tcl_interactive {
    global errorInfo

    if {[catch doit result] == 1} {
        puts stderr $errorInfo
    }
}

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Mon Oct 06 1997 - 09:26:05 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:38:01 BST