Tkinter on mac - Binding command-q to quit application

B

Brandon

Hi All,

I'm attempting to develop a Tcl/Tk application on the mac using python
and Tkinter. The one problem I'm having is adding basic keyboard
support to my application, specifically binding command-q so that it
quits the application (this is standard behavior for almost every mac
application, the equivalent of alt-f4 on windows). Has anyone
successfully been able to do this? If so, could you please share some
code which demonstrates how?


If it matters, I've been working with both python 2.3.5 and python
2.4.1:
2.3.5 (#1, Aug 22 2005, 22:13:23)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1809)]
------------------------------
$Revision: 1.177 $

and on python 2.4:
2.4.1 (#2, Mar 31 2005, 00:05:10)
[GCC 3.3 20030304 (Apple Computer, Inc. build 1666)]
------------------------------
$Revision: 1.181.2.1 $


Thanks in advance,
Brandon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,602
Members
45,185
Latest member
GluceaReviews

Latest Threads

Top