in reply to Perl TK

In perl TK there is the $widget->update() function.
But that will only help, if you call it often enough from in your sub. For example:
#!/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"; }
This works. So you can push 'button1' until the sub is running. But remember, that you have to update your mainwindow very often.
If you want to run your sub in background, you can use fork as explained above. But maybe you want to use the results of your sub for your Tk display. in that case You should use a kind of pipe for that. But I think the update function could help you.

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
    Thanks, that is more like I'm used to in TCL/TK. Yes, it's a biggol' pain in the booty, but I'm used to it...