1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
|
.. currentmodule:: gi.repository
Switch
======
A :class:`Gtk.Switch` is a widget that has two states: on or off. The user can
control which state should be active by clicking the empty area, or by dragging
the handle.
You shouldn't use the ``activate`` signal on the Gtk.Switch which is an action
signal and emitting it causes the switch to animate. Applications should never
connect to this signal, but use the ``notify::active`` signal, see the example
here below.
Example
^^^^^^^
.. image:: images/switch.png
.. literalinclude:: examples/switch.py
:linenos:
|