]> granicus.if.org Git - python/commitdiff
Merged revisions 87119 via svnmerge from
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 16:02:59 +0000 (16:02 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 16:02:59 +0000 (16:02 +0000)
svn+ssh://pythondev@svn.python.org/python/branches/py3k

........
  r87119 | ronald.oussoren | 2010-12-07 16:28:10 +0100 (Tue, 07 Dec 2010) | 2 lines

  Fix for issue #10107: Without this patch IDLE on OSX doesn't warn about unsaved files when quitting.
........

Lib/idlelib/FileList.py
Lib/idlelib/macosxSupport.py
Misc/NEWS

index 475cd3d30132e3ad1493a2dd2746254b0e50e6a4..8318ff17b2dfd5f5246aad3d2570188295c15f98 100644 (file)
@@ -43,7 +43,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 self.inversedict.keys():
             reply = edit.close()
             if reply == "cancel":
index 7d3d57b415bb58b5b94eeaa3f7240ebda38c5351..909856e359096cee18a384c01422f9389e27ff20 100644 (file)
@@ -97,6 +97,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 6ca939a1c9ad0db2d65270e3f0b8bbb17983506f..8058a2ff4b329d6ab48777bc9cdb7f2c30d405ae 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -16,6 +16,8 @@ Core and Builtins
 Library
 -------
 
+- Issue #10107: Warn about unsaved files in IDLE on OSX.
+
 - Issue #10478: Reentrant calls inside buffered IO objects (for example by
   way of a signal handler) now raise a RuntimeError instead of freezing the
   current process.