Tkinter on mac - Binding command-q to quit application

Discussion in 'Python' started by Brandon, Nov 26, 2005.

  1. Brandon

    Brandon Guest

    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:

    >>> print sys.version; print "-"*30; print Tkinter.__version__

    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:

    >>> print sys.version; print "-"*30; print Tkinter.__version__

    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
     
    Brandon, Nov 26, 2005
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jane Austine

    Memory exception with Tkinter root.quit

    Jane Austine, Nov 18, 2003, in forum: Python
    Replies:
    1
    Views:
    339
    Irmen de Jong
    Nov 18, 2003
  2. Jane Austine

    Memory exception with Tkinter root.quit

    Jane Austine, Nov 18, 2003, in forum: Python
    Replies:
    3
    Views:
    1,528
    Jane Austine
    Nov 18, 2003
  3. Java and Swing
    Replies:
    4
    Views:
    660
    Oliver Wong
    Sep 11, 2006
  4. mzdude

    Appropriate way to quit Tkinter

    mzdude, Oct 12, 2006, in forum: Python
    Replies:
    5
    Views:
    425
    mzdude
    Oct 13, 2006
  5. Patrick Stadelmann

    Quit menu notification with SWT on Mac OS X ?

    Patrick Stadelmann, May 16, 2008, in forum: Java
    Replies:
    7
    Views:
    2,862
    Patrick Stadelmann
    May 19, 2008
Loading...

Share This Page