head	1.3;
access;
symbols
	rel-5-2:1.2
	rel-5-1-patches:1.2.0.2
	rel-5-1:1.2
	rel-5-0:1.1
	rel-5-0beta:1.1;
locks; strict;
comment	@# @;


1.3
date	2000.12.06.21.21.38;	author bparker;	state dead;
branches;
next	1.2;

1.2
date	99.10.19.20.02.42;	author jra;	state Exp;
branches
	1.2.2.1;
next	1.1;

1.1
date	98.06.02.19.49.26;	author jra;	state Exp;
branches;
next	;

1.2.2.1
date	2000.12.06.21.26.49;	author bparker;	state dead;
branches;
next	;


desc
@Original
@


1.3
log
@Upgrading to newer version
@
text
@#!/bin/sh
# the next line restarts using wish \
exec wish "$0" "$@@"

# timer --
# This script generates a counter with start and stop buttons.
#
# RCS: @@(#) $Id: timer,v 1.2 1999/10/19 20:02:42 jra Exp $

label .counter -text 0.00 -relief raised -width 10
button .start -text Start -command {
    if $stopped {
	set stopped 0
	tick
    }
}
button .stop -text Stop -command {set stopped 1}
pack .counter -side bottom -fill both
pack .start -side left -fill both -expand yes
pack .stop -side right -fill both -expand yes

set seconds 0
set hundredths 0
set stopped 1

proc tick {} {
    global seconds hundredths stopped
    if $stopped return
    after 50 tick
    set hundredths [expr $hundredths+5]
    if {$hundredths >= 100} {
	set hundredths 0
	set seconds [expr $seconds+1]
    }
    .counter config -text [format "%d.%02d" $seconds $hundredths]
}

bind . <Control-c> {destroy .}
bind . <Control-q> {destroy .}
focus .
@


1.2
log
@tk 8.2.1 update
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.2 1998/09/14 18:23:30 stanton Exp $
@


1.2.2.1
log
@Upgrading to newer version
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.2 1999/10/19 20:02:42 jra Exp $
@


1.1
log
@Initial revision
@
text
@d8 1
a8 1
# SCCS: @@(#) timer 1.6 96/02/16 10:49:20
@

