summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald Oussoren <ronaldoussoren@mac.com>2023-12-11 14:22:36 (GMT)
committerGitHub <noreply@github.com>2023-12-11 14:22:36 (GMT)
commit3251ba8f1af535bf28e31a6832511ba19e96b262 (patch)
tree80a2bd398ec579726beba176cd78fc6a65a6fce9
parentc27e9d5d17abf468ea10081e177ba673316b1b98 (diff)
downloadcpython-3251ba8f1af535bf28e31a6832511ba19e96b262.zip
cpython-3251ba8f1af535bf28e31a6832511ba19e96b262.tar.gz
cpython-3251ba8f1af535bf28e31a6832511ba19e96b262.tar.bz2
gh-112898: warn about unsaved files when quitting IDLE on macOS (#112939)
* 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
-rw-r--r--Lib/idlelib/macosx.py2
-rw-r--r--Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst1
2 files changed, 2 insertions, 1 deletions
diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py
index 2ea02ec..332952f 100644
--- a/Lib/idlelib/macosx.py
+++ b/Lib/idlelib/macosx.py
@@ -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
index 0000000..1c20e46
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2023-12-10-20-01-11.gh-issue-112898.98aWv2.rst
@@ -0,0 +1 @@
+Fix processing unsaved files when quitting IDLE on macOS.