How to use dialog in class? #73
-
I want to show a AlertDialog in a class function, but the dialog wasn't popped up after I click the button. By the way, I'm still a python beginner, so maybe my question is easy to you. But it does puzzle me for hours.
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 2 replies
-
OK, I understand it. |
Beta Was this translation helpful? Give feedback.
-
Yep, you got it right. Another way would be: def play(self,e):
dia = AlertDialog(
title=Text('text'),
actions=[TextButton("OK")],
actions_alignment="end",
)
self.page.dialog = dia
dia.open = True
self.page.update() |
Beta Was this translation helpful? Give feedback.
-
Hello, I want to know how to access to the AlertDialog when you use |
Beta Was this translation helpful? Give feedback.
Yep, you got it right. Another way would be: