in reply to Constantly updating an Entry in p/Tk

What you want can be achieved using Tk::after and the -textvariable option (see Tk::options) most widgets support (like buttons, lables, ...). Here is an example:
#!/usr/bin/perl -w use strict; use Tk 8; use vars qw/ $VARIABBBBBBB $TIMER /; my $MWin = new Tk::MainWindow(-background=>'green', -width=>400, -height=>400 ,); $MWin->Label(-textvariable => \$VARIABBBBBBB, -relief => 'flat', ,)->pack(); $MWin->Button(-text => "BUTT On", -relief => 'groove', -borderwidth => 2, -padx => 3, -pady => 3, -command => \&ffffffff, ,)->pack(); &MainLoop(); sub ffffffff { $TIMER->cancel() if $TIMER; $VARIABBBBBBB = 0; $TIMER = $MWin->repeat(100, sub { $VARIABBBBBBB++}); }
Also, I am reccomending to everybody to go and read How to RTFM, it's a lifesaver.

 
______crazyinsomniac_____________________________
Of all the things I've lost, I miss my mind the most.
perl -e "$q=$_;map({chr unpack qq;H*;,$_}split(q;;,q*H*));print;$q/$q;"

Replies are listed 'Best First'.
Re: (crazyinsomniac) Re: Constantly updating an Entry in p/Tk
by readey (Sexton) on Jan 02, 2002 at 19:00 UTC
    crazyinsomniac
    Many thanks.
    Me thinks that if Tk::After had been called Tk::Repeat I might have spotted it while trawling through the manual.
    Anyways your example is great, thanks for giving me your time. readey.