ProgressBar
Förloppsindikatorer används för att visa status för en pågående operation. Exempelvis kan ProgressBar visa hur mycket av en uppgift som har slutförts.
To change the value shown, use the set_fraction() method, passing a double between 0.0 and 1.0 to provide the new fraction.
En ProgressBar är som standard horisontell och vänster-till-höger, men du kan ändra den till en vertikal förloppsindikator genom att använda metoden set_orientation().
Aktivitetsläge
Besides indicating the amount of progress that has occurred, the progress bar can also be used to indicate that there is some activity; this is done by placing the progress bar in activity mode. In this mode, the progress bar displays a small rectangle which moves back and forth. Activity mode is useful in situations where the progress of an operation cannot be calculated as a value range (e.g., receiving a file of unknown length).
To do this, you need to call the pulse() method at regular intervals. You can also choose the step size, with the set_pulse_step() method.
The progress bar can also display a configurable text string next to the bar, using the set_text() method.