Progress Bar

The progress bar is a simple widget for showing a percentage progress for task completion.

Usage

import toga

p_bar = toga.ProgressBar(max=100, value=1)

# Update progress
p_bar.value = 10

Supported Platforms

Component iOS win32 web django cocoa gtk android
ProgressBar no no no no yes no no

Reference

class toga.interface.widgets.progressbar.ProgressBar(id=None, style=None, max=None, value=None)

Progressbar widget

Instantiate a new instance of the progress bar widget

Parameters:
  • id (str) – An identifier for this widget.
  • style (colosseum.CSSNode) – an optional style object. If no style is provided then a new one will be created for the widget.
  • max (int) – The maximum value
  • value (int) – The initial value
add(child)

Add a widget as a child of this one.

Raises an ValueError if this widget is a leaf, and cannot have children.

Parameters:child (toga.Widget) – The child to add to the widget
app

The App to which this widget belongs.

Return type:toga.App
children

The children of this node.

This always returns a list, even if the node is a leaf and cannot have children.

Return type:list
Returns:A list of the children for this widget
hide()

Hide the widget from the super view.

id

The node identifier. This id can be used to target CSS directives

Return type:str
is_running

Is the progress bar currently running?

Return type:bool
max

The maximum value

Return type:int
parent

The parent of this node.

Return type:toga.Widget
set_font(font)

Set a font on this widget.

Parameters:font (toga.Font) – The new font
show()

Show the widget on the super view.

start()

Start the progress bar animation.

stop()

Stop the progress bar animation.

style

The style object for this widget.

Returns:The style for this widget
Return type:colosseum.CSSNode
value

The progress value

Return type:int
window

The Window to which this widget belongs.

Return type:toga.Window