mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
docs on await mount (#2235)
This commit is contained in:
13
docs/examples/app/widgets03.py
Normal file
13
docs/examples/app/widgets03.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Button, Welcome
|
||||
|
||||
|
||||
class WelcomeApp(App):
|
||||
def on_key(self) -> None:
|
||||
self.mount(Welcome())
|
||||
self.query_one(Button).label = "YES"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = WelcomeApp()
|
||||
app.run()
|
||||
13
docs/examples/app/widgets04.py
Normal file
13
docs/examples/app/widgets04.py
Normal file
@@ -0,0 +1,13 @@
|
||||
from textual.app import App
|
||||
from textual.widgets import Button, Welcome
|
||||
|
||||
|
||||
class WelcomeApp(App):
|
||||
async def on_key(self) -> None:
|
||||
await self.mount(Welcome())
|
||||
self.query_one(Button).label = "YES"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app = WelcomeApp()
|
||||
app.run()
|
||||
Reference in New Issue
Block a user