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

Ensure that programmatically closing the main window triggers on_exit handling #2643

Merged
merged 8 commits into from
Jun 18, 2024

Conversation

freakboy3742
Copy link
Member

@freakboy3742 freakboy3742 commented Jun 12, 2024

Derived from #2244

If you programmatically close a window, and the window is the main window, this doesn't trigger on_exit() handling (which could, in theory, reject the close).

This also means that a MainWindow can now have an on_close handler.

This PR moves the MainWindow class to window.py, in preparation for additional changes related to window handling.

Reviewing note: I've found the Window example app very helpful in manual testing of this; it contains a MainWindow that has an on_exit handler, as well as an option to create child windows, one of which has on_close handling.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@mhsmith mhsmith merged commit f90ab92 into beeware:main Jun 18, 2024
31 of 34 checks passed
@freakboy3742 freakboy3742 deleted the close-handling branch June 18, 2024 21:31
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

Successfully merging this pull request may close these issues.

2 participants