summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/Bindings.py
diff options
context:
space:
mode:
authorNed Deily <nad@acm.org>2014-03-28 03:49:14 (GMT)
committerNed Deily <nad@acm.org>2014-03-28 03:49:14 (GMT)
commitb7601676b07c7c8e79af9e7818a783b966612c34 (patch)
tree7a3d48649890a9901747b98df2a9ed13ac13d2db /Lib/idlelib/Bindings.py
parente7d532fbc9c13e00b1e5c6c0db2dba31d1212de7 (diff)
downloadcpython-b7601676b07c7c8e79af9e7818a783b966612c34.zip
cpython-b7601676b07c7c8e79af9e7818a783b966612c34.tar.gz
cpython-b7601676b07c7c8e79af9e7818a783b966612c34.tar.bz2
Issue #17654: Ensure IDLE menus are customized properly on OS X for
non-framework builds and for all variants of Tk.
Diffstat (limited to 'Lib/idlelib/Bindings.py')
-rw-r--r--Lib/idlelib/Bindings.py32
1 files changed, 7 insertions, 25 deletions
diff --git a/Lib/idlelib/Bindings.py b/Lib/idlelib/Bindings.py
index 65c0317..df2b251 100644
--- a/Lib/idlelib/Bindings.py
+++ b/Lib/idlelib/Bindings.py
@@ -8,9 +8,14 @@ the PythonShell window, and a Format menu which is only present in the Editor
windows.
"""
-import sys
from idlelib.configHandler import idleConf
-from idlelib import macosxSupport
+
+# Warning: menudefs is altered in macosxSupport.overrideRootMenu()
+# after it is determined that an OS X Aqua Tk is in use,
+# which cannot be done until after Tk() is first called.
+# Do not alter the 'file', 'options', or 'help' cascades here
+# without altering overrideRootMenu() as well.
+# TODO: Make this more robust
menudefs = [
# underscore prefixes character to underscore
@@ -81,27 +86,4 @@ menudefs = [
]),
]
-if macosxSupport.runningAsOSXApp():
- # 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]
-
- # Remove the 'Configure' entry from the options menu, it is in the
- # application menu as 'Preferences'
- del menudefs[-2][1][0:2]
-
default_keydefs = idleConf.GetCurrentKeySet()
-
-del sys