-
Notifications
You must be signed in to change notification settings - Fork 201
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update app-exit-confirm-dialog.py #167
base: main
Are you sure you want to change the base?
Conversation
Resolves the following deprecation errors: window_prevent_close() dialog() window_destroy()
@@ -34,5 +35,5 @@ def no_click(e): | |||
|
|||
page.add(Text('Try exiting this app by clicking window\'s "Close" button!')) | |||
|
|||
|
|||
flet.app(target=main) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why two lines to run the app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good catch!, copy paste typo! eek!
|
||
def yes_click(e): | ||
page.window_destroy() | ||
# Use the updated method to destroy the window |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need to add comments in this case.
def main(page: Page): | ||
page.title = "MyApp" | ||
|
||
def window_event(e): | ||
if e.data == "close": | ||
page.dialog = confirm_dialog | ||
# Use the updated method to append the dialog to the overlay |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need for this comment too.
@non-npc, thanks again for your contirbutions. While on this, could you equally update the code you work on to use |
absolutely going forward I will do this. |
|
Resolves the following deprecation errors:
window_prevent_close()
dialog()
window_destroy()