Quick search

See ToggleButtonBehavior for details.

class kivy.uix.behaviors.togglebutton.ToggleButtonBehavior(**kwargs)[source]

Bases: kivy.uix.behaviors.button.ButtonBehavior

This mixin class provides ToggleButton behavior. Please see the togglebutton module documentation for more information.

New in version 1.8.0.

allow_no_selection

This specifies whether the widgets in a group allow no selection i.e. everything to be deselected.

New in version 1.9.0.

allow_no_selection is a BooleanProperty and defaults to True

static get_widgets(groupname)[source]

Return a list of the widgets contained in a specific group. If the group doesn’t exist, an empty list will be returned.

Note

Always release the result of this method! Holding a reference to any of these widgets can prevent them from being garbage collected. If in doubt, do:

l = ToggleButtonBehavior.get_widgets('mygroup')
# do your job
del l

Warning

It’s possible that some widgets that you have previously deleted are still in the list. The garbage collector might need to release other objects before flushing them.

group

Group of the button. If None, no group will be used (the button will be independent). If specified, group must be a hashable object, like a string. Only one button in a group can be in a ‘down’ state.

group is a ObjectProperty and defaults to None.