[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ronald Oussoren ronaldousso...@mac.com added the comment: Ned: why does the patch change the signature of close_all_callback? -def close_all_callback(self, event): +def close_all_callback(self, *args, **kwds): -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ronald Oussoren ronaldousso...@mac.com added the comment: Ned: never mind the command callback has a different signature than a keybinding. Committed the patch for 3.2 in r87119. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ronald Oussoren ronaldousso...@mac.com added the comment: Merged to 3.1.x in r87120, merged to 2.7. in r87121. Ned: thanks for looking into this, doubly so because Tk-on-OSX is involved. -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: Considering the discussion on the idle-dev list back in October about this issue, I think this low-risk, high-benefit fix should be going into all three upcoming releases. -- nosy: +benjamin.peterson, georg.brandl priority: high - critical ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: The attached patches implement an exit callback for IDLE on OS X that ensures IDLE will not terminate from an application Quit command without giving the opportunity to save files. -- assignee: ned.deily - ronaldoussoren components: +Macintosh keywords: +patch priority: normal - high stage: needs patch - patch review Added file: http://bugs.python.org/file19366/issue10107-py3k-31.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Changes by Ned Deily n...@acm.org: Added file: http://bugs.python.org/file19367/issue10107-27.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: BTW, the patched IDLEs were tested on 2.7 and py3k (3.2a3+) on 10.4, 10.5, and 10.6 with the Apple-supplied Tk 8.4 (all), the Apple-supplied Tk 8.5 (available only in 10.6), ActiveState Tk 8.4 (all), and ActiveState 8.5 (all). And the patches have no affect nor are needed when linked with an X11-based Tk on OS X. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Changes by Ronald Oussoren ronaldousso...@mac.com: -- nosy: +ronaldoussoren ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Kevin Walzer wordt...@users.sourceforge.net added the comment: Try something like this: root.createcommand('::tk::mac::Quit', insert IDLE's shutdown function here) This will map whatever function IDLE calls to prompt the user to save data before closing, to the Apple quit event. -- nosy: +wordtech ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ronald Oussoren ronaldousso...@mac.com added the comment: Kevin, which versions of Tk does this work with? IDLE should at least work with the versions of Tk 8.4 and 8.5 that Apple ships with OSX 10.4, 10.5 and 10.6 (the last one being the only one with built-in support for Tk 8.5) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Kevin Walzer wordt...@users.sourceforge.net added the comment: Ronald--I think it works with both 8.4 and 8.5. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Tal Einat talei...@gmail.com added the comment: Note that some discussion about this issue is taking place on the idle-dev mailing list. Bruce Sherwood found the line root.bind('close-all-windows', flist.close_all_callback), which seems to be an unsuccessful attempt to achieve the wanted behavior. Kevin Walzer mentioned that a grep on the idlelib code doesn't turn up any references to tk::mac::Quit. I don't have access to OSX for testing. Could someone please replace the root.bind call with what Kevin suggested, and see if it solves the problem? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: It looks like the '::tk::mac::Quit' callback does not exist in the Apple-supplied Tk 8.4.7 in OS X 10.5 and 10.4, although it does work with the Apple-supplied Tk 8.4.19(?) and 8.5 in 10.6 and with a current ActiveState 8.4.19 on 10.4 through 10.6. However, instead of that, it looks like overriding the 'exit' callback will work fine on all of them. In a simple test, I'm able to intercept the Tk app quitting, post a yes/no message, and then terminate the Tk app by destroying the root. Next I'll try integrating into IDLE. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: Looks like the exit callback will work for IDLE but there are the usual edge cases and odd differences among the various branches and build options to work through and fix up. Patch forthcoming. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
New submission from Bruce Sherwood bruce.sherw...@gmail.com: It has just been discovered that at least since Python 2.6 on the Mac, quitting IDLE does not prompt to save unsaved code, which is then lost. The recently submitted diff for bringing Guilherme Polo's Google Summer of Code improvements into IDLE on Python 3 (ID 10079) does not fix the problem. -- components: IDLE messages: 118697 nosy: Bruce.Sherwood priority: normal severity: normal status: open title: Quitting IDLE on Mac doesn't save unsaved code type: behavior versions: Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Changes by Ned Deily n...@acm.org: -- nosy: +ned.deily stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Changes by Ned Deily n...@acm.org: -- versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Changes by Brian Curtin cur...@acm.org: -- nosy: +taleinat ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue10107] Quitting IDLE on Mac doesn't save unsaved code
Ned Deily n...@acm.org added the comment: The problem is that, by default on OS X, Tkinter uses Tk/Aqua which is itself a bona-fide OS X application and it creates the default menu options including a standard application quit. Looks like IDLE needs to register a hook provided by Tk/Aqua for a quit callback. (See http://permalink.gmane.org/gmane.comp.python.tkinter/1857). I'm working on a patch for it. -- assignee: - ned.deily ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue10107 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com