Firstly thanks to Kevin in my problem of downloading web pages with LWP =
while Win32::GUI::Dialog is running. Maybe there is a solution using =
fork(), but this will implies a lot of changes of my code, and I don't =
have time to do it....
Another possibility I think is to modify LWP module in order to include =
Win32::GUI::DOEvents() inside the different datagramas requests that the =
protocol TCP/IP uses. That will reduce the time on the frozen window.
Is possible to do that in the binary distribution of LWP? How ?
Maybe this is not the correct mailing list to question that...
Maybe I'm doing too much questions in perlwin32gui maling list...is not =
my intention to capitalise this mailing list, excuses to the rest of =
Regards from Catalonia,
Sorry if this was already said, but I haven't had time to pay much
attention lately, and this post caught my interest. I originally wrote
this for a program I never released. Some of what it does may or may
not be helpful, just edit it to suit your needs.
ok, heres the simple way to keep your dialog active:
my $total = 0;
my $result = "";
my($chunk,$res) = @_;
#Total amount of data downloaded
$total += length($chunk);
#Not important unless you are using the below if statement for
a status or progress bar.
$expected = $res->content_length || 0;
#Add the new data to the old data.
$result .= $chunk;
#In this program, I had a status bar, and I was reporting the
progress on it, could also be used with a progress bar... Remove if not
$win->StatusBar->Text("Rescieving: $total / $expected");
$win->StatusBar->Text("Rescieving: $total / ???");
#This is the key! Keeps the window alive.
Win32::GUI::DoEvents() >= 0 or exit;
I'm afraid I can't go into much detail at the moment to explain it, but
if you have any questions, feel free to ask.