in reply to Perl TK
This works. So you can push 'button1' until the sub is running. But remember, that you have to update your mainwindow very often.#!/usr/bin/perl -w use strict; use Tk; my $mw = MainWindow->new(); my $b1 = $mw->Button()->pack; my $b2 = $mw->Button(-command => \&test )->pack; MainLoop; sub test { print "start"; $mw->update(); for my $i (0..10000) { if ($i % 20 == 0) { print "$i\n"; $mw->update(); } } print "thats it"; }
Also look for afterIdle, DoWhenIdle, idletasks. Maybe they are needful to you
----------------------------------- --the good, the bad and the physi-- -----------------------------------
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl TK
by HamNRye (Monk) on May 10, 2001 at 04:00 UTC |