-
This doesn't work: from textual.app import App, ComposeResult
from textual.widgets import Button
class MyApp(App):
def compose(self) -> ComposeResult:
yield Button('Change label', variant='success', id='btn')
async def on_button_pressed(self, event: Button.Pressed) -> None:
self.query_one('#btn').update('Whep')
if __name__ == '__main__':
MyApp().run() |
Beta Was this translation helpful? Give feedback.
Answered by
nnmm
Dec 21, 2022
Replies: 1 comment 2 replies
-
Assign to the
|
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
nnmm
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Assign to the
label
property:self.query_one('#btn').label = 'Whep'