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
|
return 1
|
||||||
|
|
||||||
def on_click(self) -> None:
|
def on_click(self) -> None:
|
||||||
|
"""Toggle the state of the switch."""
|
||||||
self.toggle()
|
self.toggle()
|
||||||
|
|
||||||
def action_toggle(self) -> None:
|
def action_toggle(self) -> None:
|
||||||
|
"""Toggle the state of the switch."""
|
||||||
self.toggle()
|
self.toggle()
|
||||||
|
|
||||||
def toggle(self) -> None:
|
def toggle(self) -> None:
|
||||||
"""Toggle the switch value. As a result of the value changing,
|
"""Toggle the switch value.
|
||||||
a Switch.Changed message will be posted."""
|
|
||||||
|
As a result of the value changing, a `Switch.Changed` message will
|
||||||
|
be posted.
|
||||||
|
"""
|
||||||
self.value = not self.value
|
self.value = not self.value
|
||||||
|
|||||||
Reference in New Issue
Block a user