Skip to content
Discussion options

You must be logged in to vote

In your first example, you'd need to await the mount before you could query back the widgets:

--- vpet98.py-orig	2024-02-05 12:01:59
+++ vpet98.py	2024-02-05 12:02:05
@@ -14,8 +14,8 @@
         yield Results(id="results-widget")
         yield Button("Press")
 
-    def on_button_pressed(self, event: Button.Pressed) -> None:
-        self.query_one('#results-widget').mount(ContentSwitcher(Container(id="lines"), ScrollableContainer(Static(id="plain"), id="plain-container"), initial="lines", id='switcher'))
+    async def on_button_pressed(self, event: Button.Pressed) -> None:
+        await self.query_one('#results-widget').mount(ContentSwitcher(Container(id="lines"), ScrollableContainer(S…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by vpet98
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants