Switch docstring additions and tweaks
This commit is contained in:
parent
1956f7f9d7
commit
be9e34ba9a
1 changed files with 7 additions and 2 deletions
|
|
@ -144,12 +144,17 @@ class Switch(Widget, can_focus=True):
|
|||
return 1
|
||||
|
||||
def on_click(self) -> None:
|
||||
"""Toggle the state of the switch."""
|
||||
self.toggle()
|
||||
|
||||
def action_toggle(self) -> None:
|
||||
"""Toggle the state of the switch."""
|
||||
self.toggle()
|
||||
|
||||
def toggle(self) -> None:
|
||||
"""Toggle the switch value. As a result of the value changing,
|
||||
a Switch.Changed message will be posted."""
|
||||
"""Toggle the switch value.
|
||||
|
||||
As a result of the value changing, a `Switch.Changed` message will
|
||||
be posted.
|
||||
"""
|
||||
self.value = not self.value
|
||||
|
|
|
|||
Loading…
Reference in a new issue