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

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

Replies are listed 'Best First'.
Re^3: A timer in Tcl/Tk in Perl::Tk
by zentara (Cardinal) on Feb 10, 2012 at 12:31 UTC
    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