For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > September 2004 > Label update









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Label update
Helmut Blass

2004-09-23, 3:58 pm

high folks,
I've written a perl tk script which automatically sucks webpages
from the net and saves them on the users hard disk.
now I want to implement a lable by which the user is informed about
the progress of the download process, e.g. 'page 7 download ok.'
but obviously perl is so busy with the download process, that the
label can't be updated. only the last message after the end of the
download is displayed. I guess there will be the same problem with
the scale widget.
any suggesions?

thanx for your help, Helmut
thundergnat

2004-09-23, 3:58 pm

Helmut Blass wrote:
> high folks,
> I've written a perl tk script which automatically sucks webpages
> from the net and saves them on the users hard disk.
> now I want to implement a lable by which the user is informed about
> the progress of the download process, e.g. 'page 7 download ok.'
> but obviously perl is so busy with the download process, that the
> label can't be updated. only the last message after the end of the
> download is displayed. I guess there will be the same problem with
> the scale widget.
> any suggesions?
>
> thanx for your help, Helmut


Can you put a $toplevel->update; anywhere in your download loop?
Vorxion

2004-09-24, 4:01 pm

In article <415310bc$0$4053$61fed72c@news.rcn.com>, thundergnat wrote:
>Helmut Blass wrote:
>
>Can you put a $toplevel->update; anywhere in your download loop?


The question becomes, "What if I'm using LWP, and I have no place at which
to insert an update call?" I've often wondered that.

Might not apply to his situation, but I wonder all the same.

--
Vorxion - Founder of the knocking-shop of the mind.

"You have it, you sell it, you've still got it--what's the difference?"
--Diana Trent, "Waiting for God", on why a modelling agency is really a
knocking-shop. Applied by me to the field of consulting. :)

The Sci-Fi fan's solution to debt: Reverse the polarity on your charge card.
Eric Bohlman

2004-09-24, 8:56 pm

vorxion@knockingshopofthemind.com (Vorxion) wrote in
news:41543348_1@news.iglou.com:

>
> The question becomes, "What if I'm using LWP, and I have no place at
> which to insert an update call?" I've often wondered that.
>
> Might not apply to his situation, but I wonder all the same.


LWP::UserAgent allows you to specify a callback that will be called for
each "chunk" of data retrieved, with the "chunk" size being specified by
you. You can call update() for each chunk.

Vorxion

2004-09-26, 3:55 am

In article <Xns956E9D1C55629ebohlmanomsdevcom@130.133.1.4>, Eric Bohlman wrote:
>vorxion@knockingshopofthemind.com (Vorxion) wrote in
>news:41543348_1@news.iglou.com:
>
>
>LWP::UserAgent allows you to specify a callback that will be called for
>each "chunk" of data retrieved, with the "chunk" size being specified by
>you. You can call update() for each chunk.


Thanks! Didn't know about it, but it's been a while since I was deep in
the guts of LWP. Saved for future reference, as well as (hopefully)
committed to memory.

Apprecite it!

--
Vorxion - Founder of the knocking-shop of the mind.

"You have it, you sell it, you've still got it--what's the difference?"
--Diana Trent, "Waiting for God", on why a modelling agency is really a
knocking-shop. Applied by me to the field of consulting. :)

The Sci-Fi fan's solution to debt: Reverse the polarity on your charge card.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com