HTTP download progress bar...HOWTO?

David Shaffer cdshaffer at acm.org
Sun Jul 31 05:34:38 UTC 2005


Alexander Lazarević wrote:

>I think you could change the following method in HTTPSocket to get a
>progress display of any HTTP download.
>
>getRestOfBuffer: beginning totalLength: length
>...
>	'Downloading' displayProgressAt: Display center from: 0 to: length
>during: [:bar|
>	   [(response position < length) & (self isConnected | self
>dataAvailable)]
>	   whileTrue: [
>		bar value: response position.
>		(self waitForDataUntil: (Socket deadlineSecs: 5)) ifFalse: [
>...
>
>  
>
Thanks!

David




More information about the Squeak-dev mailing list