From 6b1dc3c5e09c2a6e9fccb28f81ffc002a15dcbd3 Mon Sep 17 00:00:00 2001 From: Dave Pearson Date: Fri, 3 Nov 2023 08:56:53 +0000 Subject: [PATCH] :sparkles: Example code for https://github.com/Textualize/textual/issues/3633 --- command_palette_isolation.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 command_palette_isolation.py diff --git a/command_palette_isolation.py b/command_palette_isolation.py new file mode 100644 index 0000000..abbb5ca --- /dev/null +++ b/command_palette_isolation.py @@ -0,0 +1,20 @@ +"""https://github.com/Textualize/textual/issues/3633""" + +from textual.app import App, ComposeResult +from textual.widgets import Log + +class CommandPaletteIsolation(App[None]): + + def compose(self) -> ComposeResult: + yield Log() + + def tick(self) -> None: + self.query_one(Log).write_line("Tick") + + def on_mount(self) -> None: + self.set_interval(1, self.tick) + +if __name__ == "__main__": + CommandPaletteIsolation().run() + +### command_palette_isolation.py ends here