vchristaras has asked for the wisdom of the Perl Monks concerning the following question:
XIO: fatal IO error 11 (Resource temporarily unavailable) on X server ":0.0" after 570 requests (559 known processed) with 0 events remaining.
and also it won't fire another tk main window. In the code below the call to resultsTk is ignored.
Here is my code:
my $pid = fork(); if(!defined($pid)){ print "Couldn't fork , continue"; } elsif($pid == 0){ &waitTk(); } else{ print $pid."\n"; my $min=$max; my $count=0; my $bpSum=0; foreach my $accID (keys %accDict){ #here do things sleep(20); } kill(1,$pid); waitpid($pid,0); #don't know if it's needed.Here just in case print "it got killed"; print $min."\n"; print $max."\n"; &resultsTk($min,$max); } sub resultsTk{ my ($rMin,$rMax) = @_; my $main = MainWindow->new(); $main->withdraw; my $dialog = $main->DialogBox(-buttons=>["Ok"]); $dialog->add("Label",-text=>"Min: $rMin, Max: $rMax")->pack(); my $button=$dialog->Show(); if($button eq "Ok"){ exit(0); } } sub waitTk{ local $SIG{HUP} =sub{exit(0);}; my $main = MainWindow->new(); $main->withdraw; my $dialog = $main->DialogBox(); $dialog->add("Label",-text=>"Please wait, calculating.")->pack(); my $button=$dialog->Show(); } Result: _TK_EXIT_(0) it got killed379 5168 XIO: fatal IO error 11 (Resource temporarily unavailable) on X server + ":0.0" after 570 requests (559 known processed) with 0 events remaining +.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: killing a child process which contains a Tk Main window
by zentara (Cardinal) on Dec 06, 2009 at 11:36 UTC | |
|
Re: killing a child process which contains a Tk Main window
by Marshall (Canon) on Dec 06, 2009 at 10:03 UTC | |
|
Re: killing a child process which contains a Tk Main window
by zentara (Cardinal) on Dec 07, 2009 at 12:28 UTC |