docs on await mount (#2235)

This commit is contained in:
Will McGugan
2023-04-07 09:46:27 +01:00
committed by GitHub
parent c3424b0224
commit e4b45ba63f
3 changed files with 83 additions and 0 deletions

View 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()

View 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()