head	1.2;
access;
symbols
	rel-6-1-DP:1.1.1.1
	rel-6-0-2:1.1.1.1
	rel-6-0-1-branch:1.1.1.1.0.4
	hartley-6-0-post:1.1.1.1
	hartley-6-0-pre:1.1.1.1
	rel-6-0-1:1.1.1.1
	rel-6-0:1.1.1.1
	rel-5-4:1.1.1.1
	offsite-5-3-pre:1.1.1.1
	rel-5-3:1.1.1.1
	rel-5-1-branch:1.1.1.1.0.2
	windows-6-0-branch:1.1.1.1.0.8
	ansi-6-0-branch:1.1.1.1.0.6
	tk8-3:1.1.1.1
	scriptics:1.1.1;
locks; strict;
comment	@# @;


1.2
date	2003.03.13.19.13.44;	author jra;	state dead;
branches;
next	1.1;

1.1
date	2000.12.06.21.34.18;	author bparker;	state Exp;
branches
	1.1.1.1;
next	;

1.1.1.1
date	2000.12.06.21.34.18;	author bparker;	state Exp;
branches
	1.1.1.1.6.1
	1.1.1.1.8.1;
next	;

1.1.1.1.6.1
date	2004.03.17.07.31.34;	author morrison;	state dead;
branches;
next	;

1.1.1.1.8.1
date	2004.03.15.17.37.12;	author morrison;	state dead;
branches;
next	;


desc
@@


1.2
log
@*** empty log message ***
@
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.1 2000/12/06 21:34:18 bparker 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.1
log
@Initial revision
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.2 1998/09/14 18:23:30 stanton Exp $
@


1.1.1.1
log
@Import tk8.3
@
text
@@


1.1.1.1.6.1
log
@sync branch with HEAD
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.1.1.1 2000/12/06 21:34:18 bparker Exp $
@


1.1.1.1.8.1
log
@sync with HEAD -- libtk8.3 is now libtk8.4
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.1.1.1 2000/12/06 21:34:18 bparker Exp $
@

