[Tkinter-discuss] Redefine quit menu item on Mac to quit from a Twisted/Tkinter application?

Russell Owen rowen at u.washington.edu
Thu Apr 9 01:51:33 CEST 2009


One more bit of information from Daniel A. Steffen in response to a PR  
I submitted:
<https://sourceforge.net/tracker/?func=detail&atid=112997&aid=2745650&group_id=12997 
 >

=== begin quote ===

Iif the tcl proc '::tk::mac::Quit' is defined, it gets called instead  
of exit upon receipt of a 'quit' apple event (which is what the  
standard quit menu item sends, as well as other entities in the system  
such as the dock menu quit item or the graceful Finder restart/ 
shutdown, this is why the quit menu item is special).  
If ::tk::mac::Quit returns false, the application is not quit.

other default apple event handlers are also defined, c.f.
tkMacOSXHLEvent.c

==== end quote ====

-- Russell

On Apr 8, 2009, at 4:15 PM, Kevin Walzer wrote:

> Russell Owen wrote:
>> Thank you very much!
>> That is exactly the information I needed. It worked perfectly. I  
>> already had a module that added a Quit/Exit menu for unix/Windows  
>> and I just modified it to map the "exit" command to my quit  
>> function on MacOS X. Just one new line of code and my application  
>> now quits correctly!
>> -- Russell
>
> Glad it worked!
>
> -- 
> Kevin Walzer
> Code by Kevin
> http://www.codebykevin.com



More information about the Tkinter-discuss mailing list