Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Now the confirmExit is a function that calls a perlTK widget to create a window. It has two buttons. One is an exit button and exits the program if it is pressed. Other is an ignore button that returns a $response telling that the program can go on. My question is, how can I cause the program to stop until the user presses one of the buttons? I want it so that the program has to wait for the return value from the confirmExit to continue but I know perlTK works in a strange way. I think that it will just create the window with the buttons and return an empty value without waiting for the user to press a button. The skeleton of the confirmExit function is :@reducedProtein = initializeStructure ##some operations(\@residueArr +ay,\@secondaryStructureArray); if ($ERRORCHECK ==1) #if global errorcheck is 1 {$response = confirmExit(@ERRORTYPE);} #call error function if($response==1){ simulate(@reducedProtein);} #if not, go to calculations etc
sub confirmExit { *create a window* my @ERRORTYPE=@_; *write something on the window according to errortype values* *create button exit, which exits the program when pressed* *create button ignore, which sets the value of $response to 0 if pres +sed* return $reponse;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Stopping the Program
by dirving (Friar) on Jun 21, 2008 at 01:17 UTC | |
|
Re: Stopping the Program
by pc88mxer (Vicar) on Jun 21, 2008 at 01:09 UTC | |
|
Re: Stopping the Program
by zentara (Cardinal) on Jun 21, 2008 at 11:33 UTC |