Fix for issue #10107: Without this patch IDLE on OSX doesn't warn about unsaved files...
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 15:28:10 +0000 (15:28 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 15:28:10 +0000 (15:28 +0000)
Lib/idlelib/FileList.py
Lib/idlelib/macosxSupport.py
Misc/NEWS

index 4c0076d3b6f5e05f035d1ad32712db1d0d1d57f1..37a337ed9a6d362748c522c64c9ff728c01d8f05 100644 (file)
@@ -48,7 +48,7 @@ class FileList:
     def new(self, filename=None):
         return self.EditorWindow(self, filename)
 
-    def close_all_callback(self, event):
+    def close_all_callback(self, *args, **kwds):
         for edit in list(self.inversedict):
             reply = edit.close()
             if reply == "cancel":
index 346f04d1a3b0554fce2244d04ebdd301fb185a88..f5e30407152f41bf4b50760f8b156ec5b112f177 100644 (file)
@@ -103,6 +103,11 @@ def overrideRootMenu(root, flist):
     if flist:
         root.bind('<<close-all-windows>>', flist.close_all_callback)
 
+        # The binding above doesn't reliably work on all versions of Tk
+        # on MacOSX. Adding command definition below does seem to do the
+        # right thing for now.
+        root.createcommand('exit', flist.close_all_callback)
+
 
     ###check if Tk version >= 8.4.14; if so, use hard-coded showprefs binding
     tkversion = root.tk.eval('info patchlevel')
index 8a8a7f1f8639a1c9bbc9e97397badc01006403bb..52784a1d828da4ae01b26a028bdf6e606cd15095 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -2,6 +2,18 @@
 Python News
 +++++++++++
 
+What's New in Python 3.2 Beta 2?
+================================
+
+*Release date: XXXX-XX-XX*
+
+
+Library
+-------
+
+* Issue #10107: Warn about unsaved files in IDLE on OSX.
+
+
 What's New in Python 3.2 Beta 1?
 ================================