File: spinner.rst

package info (click to toggle)
pygobject 3.55.3-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 6,000 kB
  • sloc: ansic: 39,431; python: 26,883; sh: 114; makefile: 81; xml: 35; cpp: 1
file content (35 lines) | stat: -rw-r--r-- 872 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
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
.. currentmodule:: gi.repository

Spinner
=======
The :class:`Gtk.Spinner` displays an icon-size spinning animation.
It is often used as an alternative to a :class:`Gtk.ProgressBar`
for displaying indefinite activity, instead of actual progress.

To start the animation, use :meth:`Gtk.Spinner.start`,
to stop it use :meth:`Gtk.Spinner.stop`.

Example
-------

.. image:: images/spinner.png

.. literalinclude:: examples/spinner.py
    :linenos:


Extended example
----------------
An extended example that uses a timeout function to start and stop
the spinning animation.
The :func:`on_timeout` function is called at regular intervals
until it returns ``False``, at which point the timeout is automatically
destroyed and the function will not be called again.

Example
^^^^^^^

.. image:: images/spinner_ext.png

.. literalinclude:: examples/spinner_ext.py
    :linenos: