Progress Bar Updates
Alex Tweedly
alex at tweedly.net
Thu Nov 5 17:08:40 EST 2009
Bill Vlahos wrote:
> I've successfully used libURLSetStatusCallback for getting the status
> when downloading from a web server and updating a progress bar.
> However, when I try it for opening a file from a file server it
> doesn't work. Below is the code for the file server open in a button.
>
> global vSyslogFile
>
> on mouseUp
> answer file "Open Syslog File:"
> if it is not empty then
> libURLSetStatusCallback "myProgress",the long ID of me
> show sb 1 -- progress bar
> put URL ("file:" & it) into vSyslogFile
> hide sb 1
> end if
> end mouseUp
>
> on myProgress theURL,theStatus
> if "loading" is item 1 of theStatus then set the thumbpos of sb 1 to
> (item 2 of theStatus/item 3 of theStatus)*(the endvalue of sb
> 1-startvalue of sb 1)
> end myProgress
>
> Does this not work for these kinds of put URL commands?
No, it doesn't. The docs for it say
> Summary:
> Sets up a callback message to be sent periodically during uploads and
> downloads.
When you do, e.g., put URL ("file:abc.txt") into temp
control doesn't return to you until the put is complete.
-- Alex.
More information about the use-livecode
mailing list