]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-112898: warn about unsaved files when quitting IDLE on macOS (#112939)
authorRonald Oussoren <ronaldoussoren@mac.com>
Mon, 11 Dec 2023 14:22:36 +0000 (15:22 +0100)
committerGitHub <noreply@github.com>
Mon, 11 Dec 2023 14:22:36 +0000 (15:22 +0100)
* gh-112898: warn about unsaved files when quitting IDLE on macOS

Implement the TK function ``::tk::mac::Quit`` on macOS to
ensure that IDLE asks about saving unsaved files when
quitting IDLE.

Co-authored-by: Christopher Chavez chrischavez@gmx.us
Lib/idlelib/macosx.py
Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst [new file with mode: 0644]

index 2ea02ec04d661ac1640a3e3d51d4169608b96be7..332952f4572cbda94a80e8635ee73e54a63a1834 100644 (file)
@@ -221,7 +221,7 @@ def overrideRootMenu(root, flist):
         # The binding above doesn't reliably work on all versions of Tk
         # on macOS. Adding command definition below does seem to do the
         # right thing for now.
-        root.createcommand('exit', flist.close_all_callback)
+        root.createcommand('::tk::mac::Quit', flist.close_all_callback)
 
     if isCarbonTk():
         # for Carbon AquaTk, replace the default Tk apple menu
diff --git a/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst b/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst
new file mode 100644 (file)
index 0000000..1c20e46
--- /dev/null
@@ -0,0 +1 @@
+Fix processing unsaved files when quitting IDLE on macOS.