[Python-checkins] cpython: Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx.
terry.reedy
python-checkins at python.org
Wed Jun 8 14:37:36 EDT 2016
https://hg.python.org/cpython/rev/09ec7f7322b5
changeset: 101810:09ec7f7322b5
user: Terry Jan Reedy <tjreedy at udel.edu>
date: Wed Jun 08 14:37:05 2016 -0400
summary:
Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx.
files:
Lib/idlelib/macosx.py | 11 +++++++++++
Lib/idlelib/pyshell.py | 8 --------
2 files changed, 11 insertions(+), 8 deletions(-)
diff --git a/Lib/idlelib/macosx.py b/Lib/idlelib/macosx.py
--- a/Lib/idlelib/macosx.py
+++ b/Lib/idlelib/macosx.py
@@ -206,6 +206,16 @@
# remove redundant "IDLE Help" from menu
del mainmenu.menudefs[-1][1][0]
+def fixb2context(root):
+ '''Removed bad AquaTk Button-2 (right) and Paste bindings.
+
+ They prevent context menu access and seem to be gone in AquaTk8.6.
+ See issue #24801.
+ '''
+ root.unbind_class('Text', '<B2>')
+ root.unbind_class('Text', '<B2-Motion>')
+ root.unbind_class('Text', '<<PasteSelection>>')
+
def setupApp(root, flist):
"""
Perform initial OS X customizations if needed.
@@ -227,3 +237,4 @@
hideTkConsole(root)
overrideRootMenu(root, flist)
addOpenEventSupport(root, flist)
+ fixb2context()
diff --git a/Lib/idlelib/pyshell.py b/Lib/idlelib/pyshell.py
--- a/Lib/idlelib/pyshell.py
+++ b/Lib/idlelib/pyshell.py
@@ -1548,14 +1548,6 @@
flist = PyShellFileList(root)
macosx.setupApp(root, flist)
- if macosx.isAquaTk():
- # There are some screwed up <2> class bindings for text
- # widgets defined in Tk which we need to do away with.
- # See issue #24801.
- root.unbind_class('Text', '<B2>')
- root.unbind_class('Text', '<B2-Motion>')
- root.unbind_class('Text', '<<PasteSelection>>')
-
if enable_edit:
if not (cmd or script):
for filename in args[:]:
--
Repository URL: https://hg.python.org/cpython
More information about the Python-checkins
mailing list