# ProgressBar (Python)

Marta Maria Casetti
mmcasetti@gmail.com 2012
A widget which indicates progress visually.

# ProgressBar

Pressing any key stops and starts this ProgressBar.

This ProgressBar is stopped and started by pressing any key.

# Code used to generate this example

# Useful methods for a ProgressBar widget

Instead of `pulse()`, that makes the bar go back and forth, if we want the ProgressBar to "fill in" a fraction (a `float` between `0.0` and `1.0` included) of the bar that has been completed, use `set_fraction(fraction)`.

To set a text and show it (superimposed over the bar) use `set_text("some text")` and `set_show_text(True)`. If a text is not set and `set_show_text(True)` the text will be the percentage of the work that has been completed.

# API References

In this sample we used the following:

GtkProgressBar

GLib - The Main Event Loop

Gdk - Key Values