in reply to Tk buttons: Run/Cancel

Hello,
I had a similar problem recently. The suggestions made here were not fitting for me since I live under Win32.

I solved it roughly that way:
1. The "Cancel"-Button sets $abort=1;.
2. The LongRun-Routine behind my "Run"-button:
sub runlong { # <== Maybe set local grab here for cancel-button my $t=time()+30; while(time()<$t) # loop a loong time =8] { # Insert what ever need here # $mw->update(idletask); # Refresh Window DoOneEvent(0); # Simulate Mainloop. last if $abort != 0; # Bail out on User interaction } # <== Maybe remove grab here, if set above $abort=0; }
- Steppl