From 1063c0f94cb07a5612a8217ff550f97db83a55b1 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Wed, 19 Apr 2023 10:04:05 +0100 Subject: [PATCH] Make Switch event handlers private See #2324. --- src/textual/widgets/_switch.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/textual/widgets/_switch.py b/src/textual/widgets/_switch.py index abccfd985..8542f5404 100644 --- a/src/textual/widgets/_switch.py +++ b/src/textual/widgets/_switch.py @@ -5,6 +5,7 @@ from typing import TYPE_CHECKING, ClassVar from rich.console import RenderableType from ..binding import Binding, BindingType +from ..events import Click from ..geometry import Size from ..message import Message from ..reactive import reactive @@ -153,7 +154,7 @@ class Switch(Widget, can_focus=True): def get_content_height(self, container: Size, viewport: Size, width: int) -> int: return 1 - def on_click(self) -> None: + async def _on_click(self, _: Click) -> None: """Toggle the state of the switch.""" self.toggle()