mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
Switch docstring additions and tweaks
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user