mirror of
https://github.com/Textualize/textual.git
synced 2025-10-17 02:38:12 +03:00
docs fix
This commit is contained in:
@@ -5,7 +5,7 @@ from textual.widgets import Button, Welcome
|
||||
class WelcomeApp(App):
|
||||
def on_key(self) -> None:
|
||||
self.mount(Welcome())
|
||||
self.query_one(Button).label = "YES"
|
||||
self.query_one(Button).label = "YES!"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -5,7 +5,7 @@ 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"
|
||||
self.query_one(Button).label = "YES!"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -125,7 +125,7 @@ This may be a problem if you want to make any changes to the widget in the same
|
||||
|
||||
Let's first illustrate the problem with an example.
|
||||
The following code will mount the Welcome widget in response to a key press.
|
||||
It will also attempt to modify the Button in the Welcome widget by changing its label from "OK" to "YES".
|
||||
It will also attempt to modify the Button in the Welcome widget by changing its label from "OK" to "YES!".
|
||||
|
||||
```python hl_lines="2 8"
|
||||
from textual.app import App
|
||||
@@ -173,7 +173,6 @@ Here's the output. Note the changed button text:
|
||||
```{.textual path="docs/examples/app/widgets04.py" press=["a"]}
|
||||
```
|
||||
|
||||
|
||||
## Exiting
|
||||
|
||||
An app will run until you call [App.exit()][textual.app.App.exit] which will exit application mode and the [run][textual.app.App.run] method will return. If this is the last line in your code you will return to the command prompt.
|
||||
|
||||
Reference in New Issue
Block a user