how does a progress bar work anyway

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
Just curious. The only two ways I can think of:

1. The app knows how many bytes it has to handle and takes a count at intervals and does the math

2. There are embedded "milestones" [bytestones?] and as the app hits one it is told "tell the progress bar we're 30% done"

just curious
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Both, when you setup a progress bar control you can tell it your min/max and an increment value and then call a step function and it'll update the bar by the increment value. Or you can just call a set function to set it to a certain percentage.
 

Felecha

Golden Member
Sep 24, 2000
1,434
0
0
ok, cool. I've done some Java and .Net programming, I just never did progress bars, and dont have access to either to look at them. I was just idly wondering today

Thanks

 

Red Squirrel

No Lifer
May 24, 2003
70,667
13,835
126
www.anyf.ca
In windows I think some even do a rough time estimate then move it based on time. that's why some stuff often stays stuck at 99 as it's taking longer then the program calculated.

The milestone one is probably the most used though, as if you notice certain processes they always seem to stop at the same numbers.