[Project_owners] Refresh a progressBar

Frank DiLecce frank at supportware.net
Fri Jan 21 11:06:19 EST 2005

----- Original Message -----
*From:* Didier Ernotte <didier at ernotte.com>
*To:* Mozdev Project Owners List <project_owners at mozdev.org>
*Sent:* Friday, January 21, 2005 10:53:49 AM
*Subject:* [Project_owners] Refresh a progressBar

>I have a progressBar in a Dialog and I want to change the value of it
>as I process a loop. The problem is that event if I update the value
>attribute of the progressbar, it's not refresh on the screen (look like
>my process takle all the juice and the GUI get no event to refresh).
>The progressBar is updated when my process is finished, so I can see
>only 2 values : the 0 and 100%.... this is not what a progress bar is
>supposed to show. Any idea how to refresh the progressBar ?
You must allow your process to yield at some point..  This will allow 
events to fire ( including painting the UI )

so.. break up your process into 'chunks' and process a chunk at a time,
using setTimeout(processChunk,1,x,y,z)  to start the next chunk
.... processChunk should be YOUR function's name
.... x, y, and z are the parameters to pass to the function, when it 
gets called

Good luck

RTFM first!  Don't wait til all else fails

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mozdev.org/pipermail/project_owners/attachments/20050121/faf80f8c/attachment.htm

More information about the Project_owners mailing list