I include this simple program because I want to download some web pages without 
losing the user interaction. How I have to change this code in order to avoid 
the error in the second click ?

If someone have some example for doing this I will be very very happy !

##Interfície gràfica pel Parsev70b
##AUTOR: Guillem Cunillera i Wefers


use Win32::GUI;
use Win32::API;
use LWP::UserAgent; 
use LWP::Simple;
use URI::https;
use LWP::Protocol::https;

my $w_tutor = Win32::GUI::Window->new (
 -top  => 0,
 -left  => 0,
 -width     => 600, 
 -height    => 600,
    -minsize => 600,600
 -text  => "Tutor", 
 -name  => "e_w_tutor",);


my $download = $w_tutor->AddButton(
 -text  => "OBTENIR DADES", # Text al botó
 -left  => 400,
 -top  => 160,
 -height  => 25,
 -name  => "download",
 );

sub download_Click {
 
 $download->Disable();
  
 if ($ere=fork() ) {
 
     print "A\n"; 
 } 
 else 
 {         
    print "B \n";
    $download->Enable();
    exit(0);
  
 }  
 print "acabo click \n";
 return 1;       
}

 
# ---------------------------
sub e_w_tutor_Terminate {
# --------------------------
 $w_tutor->Hide();
 
 print "adeu! \n";
 return -1;

}

$w_tutor->Show ();

Win32::GUI::Dialog();  # Inici d'execucio gràfica

Reply via email to