Janish has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks
Pls help me on this. I have a few of jobs whereby each of them will be triggered in sequential manner when a "RunAll" button is clicked. How do I set another "KillAll" button to kill all the invoked jobs in case I want to abort all the rest of jobs halfway?
Below is how I invoked my jobs (note: I'm using Tk::ExecuteCommand in my script). Each job is triggered successfully one after another but it only kill job1 in below code for sub KillAll
Code for "RunAll" button:-
sub RunAll{ $run_job1_bttn->invoke(); $run_job2_bttn->invoke(); $run_job3_bttn->invoke(); }
Code for "KillAll" button:-
sub KillAll { my $msg = $mw->Dialog( -title => "Warning", -buttons => [ "Yes", "Cancel" ], ); $msg->add("Label", -text => "Sure to kill all jobs?", -wraplength => '300', )->pack(); my $killbutton = $msg->Show; if ($killbutton eq "Yes") { $ec_job1->kill_command; $ec_job2->kill_command; $ec_job3->kill_command;#each $ec_job is execute_command callin +g an external script. } }
Pls suggest a method so that I can kill all running jobs successfully without abort the window. Thank you!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Kill a serial of jobs with a button click in Perl/TK
by GotToBTru (Prior) on May 22, 2015 at 16:30 UTC | |
by Janish (Sexton) on May 25, 2015 at 01:41 UTC | |
by soonix (Chancellor) on May 25, 2015 at 05:57 UTC | |
by afoken (Chancellor) on May 25, 2015 at 07:55 UTC | |
by soonix (Chancellor) on May 25, 2015 at 11:33 UTC | |
| |
by Janish (Sexton) on May 26, 2015 at 06:02 UTC | |
|
Re: Kill a serial of jobs with a button click in Perl/TK
by Anonymous Monk on May 22, 2015 at 10:37 UTC |