Web Analytics Made Easy - Statcounter
Skip to content

ProgressBar

Progress Bar Element - Displays a colored bar that is shaded as progress of some operation is made

ProgressBar(
    max_value,
    orientation = None,
    size = (None, None),
    start_value = 0,
    auto_size_text = None,
    bar_color = (None, None),
    style = None,
    border_width = None,
    relief = None,
    key = None,
    k = None,
    pad = None,
    visible = True,
    size_px = (None, None),
    metadata = None
)

Parameter Descriptions

Name Type Default Description
auto_size_text bool None Not sure why this is here
bar_color (str, str) or str (None, None) The 2 colors that make up a progress bar. Either a tuple of 2 strings or a string. Tuple - (bar, background). A string with 1 color changes the background of the bar only. A string with 2 colors separated by "on" like "red on blue" specifies a red bar on a blue background.
border_width int None The amount of pixels that go around the outside of the bar
k str or int or tuple or object None Same as the Key. You can use either k or key. Which ever is set will be used.
key str or int or tuple or object None Used with window.find_element and with return values to uniquely identify this element to uniquely identify this element
max_value int max value of progressbar
metadata Any None User metadata that can be set to ANYTHING
orientation str None 'horizontal' or 'vertical'
pad (int, int or (int, int),(int,int) or int,(int,int)) or ((int, int),int) None Amount of padding to put around element in pixels (left/right, top/bottom) or ((left, right), (top, bottom)) or an int. If an int, then it's converted into a tuple (int, int)
relief str None relief style. Values are same as progress meter relief values. Can be a constant or a string: RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID (Default value = DEFAULT_PROGRESS_BAR_RELIEF)
size (int, int) or (int, None) (None, None) Size of the bar. If horizontal (chars long, pixels wide), vert (chars high, pixels wide). Vert height measured using horizontal chars units.
size_px (int, int) or (None, None) (None, None) Size in pixels (length, width). Will be used in place of size parm if specified
start_value int 0 Initial start value
style str None Progress bar style defined as one of these 'default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative'
visible bool True set visibility state of the element

Class Properties

This class has no public properties

Class Methods

 def expand
 def get_stylesheet
 def set_stylesheet
 def update
 def update_bar

expand

WARNING - NOT USED IN PySimpleGUIQt port. Provided as dummy method

expand(
    expand_x = False,
    expand_y = False,
    expand_row = True
)

Parameter Descriptions

Name Type Default Description
expand_row bool True If True the row containing the element will also expand. Without this your element is "trapped" within the row
expand_x bool False If True Element will expand in the Horizontal directions
expand_y bool False If True Element will expand in the Vertical directions
RETURN None None

get_stylesheet

Returns the stylesheet for element's associated Qt Widget

get_stylesheet()

Parameter Descriptions

Name Type Default Description
RETURN str stylesheet

set_stylesheet

Sets the stylesheet for a Qt Widget

set_stylesheet(
    stylesheet
)

Parameter Descriptions

Name Type Default Description
stylesheet str Stylesheet (string) to set stylesheet to

update

Changes some of the settings for the ProgressBar Element. Must call Window.Read or Window.Finalize prior

Changes will not be visible in your window until you call window.read or window.refresh.

If you change visibility, your element may MOVE.

update(
    visible = None
)

Parameter Descriptions

Name Type Default Description
visible bool None control visibility of element

update_bar

Change what the bar shows by changing the current count and optionally the max count

update_bar(
    current_count,
    max = None
)

Parameter Descriptions

Name Type Default Description
current_count int sets the current value
max int None changes the max value