summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/Bindings.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/idlelib/Bindings.py')
-rw-r--r--Lib/idlelib/Bindings.py26
1 files changed, 26 insertions, 0 deletions
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index b5e90b0..d24be3f 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