timer

来自「genesis 2000 v9.1软件下载」· 代码 · 共 41 行

TXT
41
字号
#!/bin/sh# the next line restarts using wish \exec wish8.0 "$0" "$@"# timer --# This script generates a counter with start and stop buttons.## RCS: @(#) $Id: timer,v 1.2 1998/09/14 18:23:30 stanton Exp $label .counter -text 0.00 -relief raised -width 10button .start -text Start -command {    if $stopped {	set stopped 0	tick    }}button .stop -text Stop -command {set stopped 1}pack .counter -side bottom -fill bothpack .start -side left -fill both -expand yespack .stop -side right -fill both -expand yesset seconds 0set hundredths 0set stopped 1proc 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 .

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?