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.
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index b5e90b0..a695ab7 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -80,6 +80,32 @@
    ]),
 ]
 
+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