Skip to content
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

Block page when program exits. #4756

Open
1 task done
changhexuefei opened this issue Jan 23, 2025 · 0 comments
Open
1 task done

Block page when program exits. #4756

changhexuefei opened this issue Jan 23, 2025 · 0 comments

Comments

@changhexuefei
Copy link

Duplicate Check

Describe the bug

Hi, when I use this code to close the program, the program blocks for some time before actually exiting.

Code sample

Code
def main(page: ft.Page):
    page.title = "Test App"

    def yes_click(e):
        print("Closing window....")
        page.window.destroy()
        print("Window closed.")

    button = ft.ElevatedButton(text="Close", on_click=yes_click)
    page.add(button)


ft.app(target=main)

To reproduce

After the program runs, click the close button and the program will block for a certain period of time before exiting.

Expected behavior

No response

Screenshots / Videos

Captures

[Upload media here]

Operating System

Windows

Operating system details

Windows11

Flet version

Name: flet Version: 0.25.2

Regression

No, it isn't

Suggestions

No response

Logs

Logs
[Paste your logs here]

Additional details

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant