Skip to content

Commit

Permalink
docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
willmcgugan committed Apr 29, 2024
1 parent f042b9d commit 0f62d13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/textual/widgets/_button.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,13 @@ async def _on_click(self, event: events.Click) -> None:
self.press()

def press(self) -> Self:
"""Respond to a button press.
"""Animate the button and send the [Pressed][textual.widgets.button.Button.Pressed] message.
Can be used to simulate the button being pressed by a user.
Returns:
The button instance."""
The button instance.
"""
if self.disabled or not self.display:
return self
# Manage the "active" effect:
Expand Down

0 comments on commit 0f62d13

Please sign in to comment.