Skip to content
Toga
0.5.3.dev143+gabcc6cdb6

ActivityIndicator

A small animated indicator showing activity on a task of indeterminate length, usually rendered as a "spinner" animation.

/reference/images/activityindicator-cocoa.png

/reference/images/activityindicator-gtk.png

/reference/images/activityindicator-winforms.png

/reference/images/activityindicator-android.png

/reference/images/activityindicator-iOS.png

/reference/images/activityindicator-web.png

Not supported

Usage

import toga

indicator = toga.ActivityIndicator()

# Start the animation
indicator.start()

# Stop the animation
indicator.stop()

Notes

  • The ActivityIndicator will always take up a fixed amount of physical space in a layout. However, the widget will not be visible when it is in a "stopped" state.

Reference

toga.ActivityIndicator

ActivityIndicator(id=None, style=None, running=False, **kwargs)

Bases: Widget

Create a new ActivityIndicator widget.

PARAMETER DESCRIPTION
id

The ID for the widget.

TYPE: str | None DEFAULT: None

style

A style object. If no style is provided, a default style will be applied to the widget.

TYPE: StyleT | None DEFAULT: None

running

Describes whether the indicator is running at the time it is created.

TYPE: bool DEFAULT: False

kwargs

Initial style properties.

DEFAULT: {}

enabled property writable

enabled

Is the widget currently enabled? i.e., can the user interact with the widget?

ActivityIndicator widgets cannot be disabled; this property will always return True; any attempt to modify it will be ignored.

is_running property

is_running

Determine if the activity indicator is currently running.

Use start() and stop() to change the running state.

True if this activity indicator is running; False otherwise.

focus

focus()

No-op; ActivityIndicator cannot accept input focus.

start

start()

Start the activity indicator.

If the activity indicator is already started, this is a no-op.

stop

stop()

Stop the activity indicator.

If the activity indicator is already stopped, this is a no-op.