Skip to content

Commit 3251ba8

Browse files
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 [email protected]
1 parent c27e9d5 commit 3251ba8

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

Lib/idlelib/macosx.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ def help_dialog(event=None):
221221
# The binding above doesn't reliably work on all versions of Tk
222222
# on macOS. Adding command definition below does seem to do the
223223
# right thing for now.
224-
root.createcommand('exit', flist.close_all_callback)
224+
root.createcommand('::tk::mac::Quit', flist.close_all_callback)
225225

226226
if isCarbonTk():
227227
# for Carbon AquaTk, replace the default Tk apple menu
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix processing unsaved files when quitting IDLE on macOS.

0 commit comments

Comments
 (0)