Debian Codegraph @

docs/tutorials/gtk4/display-widgets/spinner.rst

raw
1 .. currentmodule:: gi.repository
2
3 Spinner
4 =======
5 The :class:`Gtk.Spinner` displays an icon-size spinning animation.
6 It is often used as an alternative to a :class:`Gtk.ProgressBar`
7 for displaying indefinite activity, instead of actual progress.
8
9 To start the animation, use :meth:`Gtk.Spinner.start`,
10 to stop it use :meth:`Gtk.Spinner.stop`.
11
12 Example
13 -------
14
15 .. image:: images/spinner.png
16
17 .. literalinclude:: examples/spinner.py
18 :linenos:
19
20
21 Extended example
22 ----------------
23 An extended example that uses a timeout function to start and stop
24 the spinning animation.
25 The :func:`on_timeout` function is called at regular intervals
26 until it returns ``False``, at which point the timeout is automatically
27 destroyed and the function will not be called again.
28
29 Example
30 ^^^^^^^
31
32 .. image:: images/spinner_ext.png
33
34 .. literalinclude:: examples/spinner_ext.py
35 :linenos: