ActivityIndicator¶
Usage¶
On most platforms, an ActivityIndicator is usually rendered as a "spinner".
import toga
indicator = toga.ActivityIndicator()
# Start the animation
indicator.start()
# Stop the animation
indicator.stop()
Notes¶
- The
ActivityIndicatorwill 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¶
Bases: Widget
Source code in core/src/toga/widgets/activityindicator.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 | |
enabled
property
writable
¶
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
¶
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.
__init__(id=None, style=None, running=False, **kwargs)
¶
Create a new ActivityIndicator widget.
:param id: The ID for the widget. :param style: A style object. If no style is provided, a default style will be applied to the widget. :param running: Describes whether the indicator is running at the time it is created. :param kwargs: Initial style properties.
Source code in core/src/toga/widgets/activityindicator.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | |
focus()
¶
No-op; ActivityIndicator cannot accept input focus.
Source code in core/src/toga/widgets/activityindicator.py
46 47 48 | |
start()
¶
Start the activity indicator.
If the activity indicator is already started, this is a no-op.
Source code in core/src/toga/widgets/activityindicator.py
60 61 62 63 64 65 66 | |
stop()
¶
Stop the activity indicator.
If the activity indicator is already stopped, this is a no-op.
Source code in core/src/toga/widgets/activityindicator.py
68 69 70 71 72 73 74 | |