[Idle-dev] Submitted Guilherme Polo's enhancement

Bruce Sherwood basherwo at ncsu.edu
Fri Oct 15 06:25:23 CEST 2010

I'm trying to find out why when you quit on the Mac unsaved changes
don't trigger an invitation to save the file. Instead, IDLE quits and
you lose your edits.

There is code to bind cmd-q to the edit window and, on the Mac, to the
Tk root, through macosxSupport.setupApp which calls macosxSupport
overrideRootMenu. I've tried printing something in the callback
routine (FileList.close_all_callback), and I don't see the print. I've
tried commenting out one or both of these bindings, and I can still
quit with cmd-q. I've looked a bit at the tkinter code. I'm beginning
to have the sinking feeling that there's something in the library
_tkinter.so itself that is swallowing cmd-q and not sending it to
tkinter, so it doesn't get to IDLE. I have the vague notion that there
have been some problems with tkinter on the Mac, but I don't know any

Is there someone who reads this idle-dev list who knows enough about
_tkinter.so on the Mac to be able to say whether this could be the
problem? If _tkinter.so doesn't pass through to IDLE a cmd-q event (or
the equivalent menu choice to quit), there's nothing we can do to make
IDLE work properly on the Mac without changes to _tkinter.so. I don't
feel competent to design a clean simple tkinter test to prove the
point and post a bug report.

Of course I could be missing something somehow, but on Windows if I
put a print statement in the callback routine I see that text when I
press ctrl-q.

Bruce Sherwood

More information about the IDLE-dev mailing list