]> granicus.if.org Git - python/commitdiff
Issue #27262: move Aqua unbinding code, which enable context menus, to maxosx.
authorTerry Jan Reedy <tjreedy@udel.edu>
Wed, 8 Jun 2016 18:37:05 +0000 (14:37 -0400)
committerTerry Jan Reedy <tjreedy@udel.edu>
Wed, 8 Jun 2016 18:37:05 +0000 (14:37 -0400)
Lib/idlelib/macosx.py
Lib/idlelib/pyshell.py

index 8c50a598b23f55de39494435c6a912f59b009bf1..9d7563138898e769e2815aef63d1441900725355 100644 (file)
@@ -206,6 +206,16 @@ def overrideRootMenu(root, flist):
         # 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 @@ def setupApp(root, flist):
         hideTkConsole(root)
         overrideRootMenu(root, flist)
         addOpenEventSupport(root, flist)
+        fixb2context()
index 8341cd952bb96ddd295c565159bc7969202a4add..9fc46caa638ea8f99f49f6211bfecf0694653e24 100755 (executable)
@@ -1548,14 +1548,6 @@ def main():
     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[:]: