head	1.4;
access;
symbols
	ansi-20040405-merged:1.3.4.1
	postmerge-20040405-ansi:1.3
	premerge-20040404-ansi:1.3
	postmerge-autoconf:1.3
	autoconf-freeze:1.1.6.3
	premerge-autoconf:1.3
	postmerge-20040315-windows:1.3
	premerge-20040315-windows:1.3
	windows-20040315-freeze:1.3.2.1
	autoconf-20031203:1.1.6.1
	autoconf-20031202:1.1
	autoconf-branch:1.1.0.6
	phong-branch:1.1.0.4
	photonmap-branch:1.1.0.2
	windows-branch:1.3.0.2
	ansi-branch:1.3.0.4;
locks; strict;
comment	@# @;


1.4
date	2004.05.21.18.01.07;	author morrison;	state dead;
branches;
next	1.3;

1.3
date	2004.03.04.19.49.20;	author morrison;	state Exp;
branches
	1.3.2.1
	1.3.4.1;
next	1.2;

1.2
date	2003.11.07.14.58.23;	author morrison;	state Exp;
branches;
next	1.1;

1.1
date	2003.03.13.20.04.26;	author jra;	state Exp;
branches
	1.1.6.1;
next	;

1.1.6.1
date	2003.12.03.16.25.21;	author erikg;	state Exp;
branches;
next	1.1.6.2;

1.1.6.2
date	2004.02.12.19.02.43;	author erikg;	state Exp;
branches;
next	1.1.6.3;

1.1.6.3
date	2004.03.15.13.56.02;	author erikg;	state Exp;
branches;
next	;

1.3.2.1
date	2004.03.12.10.00.16;	author morrison;	state Exp;
branches;
next	;

1.3.4.1
date	2004.03.17.21.20.59;	author morrison;	state Exp;
branches;
next	;


desc
@@


1.4
log
@moved from top-level to src/other/.
@
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.3 2004/03/04 19:49:20 morrison Exp $

label .counter -text 0.00 -relief raised -width 10 -padx 2m -pady 1m
button .start -text Start -command {
    if {$stopped} {
	set stopped 0
	set startMoment [clock clicks -milliseconds]
	tick
	.stop configure -state normal
	.start configure -state disabled
    }
}
button .stop -text Stop -state disabled -command {
    set stopped 1
    .stop configure -state disabled
    .start configure -state normal
}
pack .counter -side bottom -fill both
pack .start -side left -fill both -expand yes
pack .stop -side right -fill both -expand yes

set startMoment {}

set stopped 1

proc tick {} {
    global startMoment stopped
    if {$stopped} {return}
    after 50 tick
    set elapsedMS [expr {[clock clicks -milliseconds] - $startMoment}]
    .counter config -text [format "%.2f" [expr {double($elapsedMS)/1000}]]
}

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

# Local Variables:
# mode: tcl
# End:
@


1.3
log
@Updated to tk 8.4.6
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.3 2001/10/29 16:23:33 dkf Exp $
@


1.3.4.1
log
@sync branch with HEAD
@
text
@d8 1
a8 1
# RCS: @@(#) $Id$
@


1.3.2.1
log
@merge from HEAD
@
text
@d8 1
a8 1
# RCS: @@(#) $Id$
@


1.2
log
@updated tk to 8.4.4
@
text
@@


1.1
log
@*** empty log message ***
@
text
@@


1.1.6.1
log
@updates from HEAD, part 1
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.2 2003/11/07 14:58:23 morrison Exp $
@


1.1.6.2
log
@merge from HEAD
@
text
@@


1.1.6.3
log
@merge from head
@
text
@d8 1
a8 1
# RCS: @@(#) $Id: timer,v 1.1.6.2 2004/02/12 19:02:43 erikg Exp $
@


