in reply to Re^2: A timer in Tcl/Tk in Perl::Tk
in thread A timer in Tcl/Tk in Perl::Tk

Just one last thing... How would you implement a "Clear" or "Reset" button in this code?

How would you? This isn't a code writing service, we just point the way. :-)

As mentioned in that script, it could be done better, with a single button for start/stop, using $button->configure() to toggle the buttons text and function. To clear it back to zero, from first glance, it looks like the timer data is stored in -textvariable => \$tinfo{'t'}, so zero out $info{'t'} or possibly all of %info's keys.


I'm not really a human, but I play one on earth.
Old Perl Programmer Haiku ................... flash japh