diff options
author | Ronald Oussoren <ronaldoussoren@mac.com> | 2006-06-11 14:33:36 +0000 |
---|---|---|
committer | Ronald Oussoren <ronaldoussoren@mac.com> | 2006-06-11 14:33:36 +0000 |
commit | 19302d927e6688e02553df16177e4867e2d0e3b3 (patch) | |
tree | 38fbc0f20e5b05833d09a560ea8d081393f19768 /Lib/idlelib/Bindings.py | |
parent | 6aaccc6b55a684771abfdad74bea742c25ded506 (diff) | |
download | cpython-git-19302d927e6688e02553df16177e4867e2d0e3b3.tar.gz |
This patch improves the L&F of IDLE on OSX. The changes are conditionalized on
being in an IDLE.app bundle on darwin. This does a slight reorganisation of the
menus and adds support for file-open events.
Diffstat (limited to 'Lib/idlelib/Bindings.py')
-rw-r--r-- | Lib/idlelib/Bindings.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py index b5e90b009a..a695ab7a00 100644 --- a/Lib/idlelib/Bindings.py +++ b/Lib/idlelib/Bindings.py @@ -80,6 +80,32 @@ menudefs = [ ]), ] +import sys +if sys.platform == 'darwin' and '.app' in sys.executable: + # Running as a proper MacOS application bundle. This block restructures + # the menus a little to make them conform better to the HIG. + + quitItem = menudefs[0][1][-1] + closeItem = menudefs[0][1][-2] + + # Remove the last 3 items of the file menu: a separator, close window and + # quit. Close window will be reinserted just above the save item, where + # it should be according to the HIG. Quit is in the application menu. + del menudefs[0][1][-3:] + menudefs[0][1].insert(6, closeItem) + + # Remove the 'About' entry from the help menu, it is in the application + # menu + del menudefs[-1][1][0:2] + + menudefs.insert(0, + ('application', [ + ('About IDLE', '<<about-idle>>'), + None, + ('_Preferences....', '<<open-config-dialog>>'), + ])) + + default_keydefs = idleConf.GetCurrentKeySet() del sys |