From e27064e9b6cc18b4715e6ab7baf1c11d3e989ff2 Mon Sep 17 00:00:00 2001 From: Falko Schindler Date: Fri, 6 Sep 2024 14:20:51 +0200 Subject: [PATCH] raise exception when setting visibility on notification or timer (fixes #3670) --- nicegui/elements/notification.py | 3 +++ nicegui/elements/timer.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nicegui/elements/notification.py b/nicegui/elements/notification.py index 9a3fb1d4c..bad7dfc3e 100644 --- a/nicegui/elements/notification.py +++ b/nicegui/elements/notification.py @@ -196,3 +196,6 @@ def on_dismiss(self, callback: Callable[..., Any]) -> Self: def dismiss(self) -> None: """Dismiss the notification.""" self.run_method('dismiss') + + def set_visibility(self, visible: bool) -> None: + raise NotImplementedError('Use `dismiss()` to remove the notification. See #3670 for more information.') diff --git a/nicegui/elements/timer.py b/nicegui/elements/timer.py index 116bb2054..e40209e27 100644 --- a/nicegui/elements/timer.py +++ b/nicegui/elements/timer.py @@ -128,3 +128,6 @@ def _cleanup(self) -> None: if not self._deleted: assert self.parent_slot self.parent_slot.parent.remove(self) + + def set_visibility(self, visible: bool) -> None: + raise NotImplementedError('Use `activate()`, `deactivate()` or `cancel()`. See #3670 for more information.')