Merge with 3.5

This commit is contained in:
Terry Jan Reedy 2015-09-22 21:11:06 -04:00
commit 6f1f091e80
2 changed files with 13 additions and 5 deletions

View File

@ -175,13 +175,13 @@ class EditorWindow(object):
if macosxSupport.isAquaTk(): if macosxSupport.isAquaTk():
# Command-W on editorwindows doesn't work without this. # Command-W on editorwindows doesn't work without this.
text.bind('<<close-window>>', self.close_event) text.bind('<<close-window>>', self.close_event)
# Some OS X systems have only one mouse button, # Some OS X systems have only one mouse button, so use
# so use control-click for pulldown menus there. # control-click for popup context menus there. For two
# (Note, AquaTk defines <2> as the right button if # buttons, AquaTk defines <2> as the right button, not <3>.
# present and the Tk Text widget already binds <2>.)
text.bind("<Control-Button-1>",self.right_menu_event) text.bind("<Control-Button-1>",self.right_menu_event)
text.bind("<2>", self.right_menu_event)
else: else:
# Elsewhere, use right-click for pulldown menus. # Elsewhere, use right-click for popup menus.
text.bind("<3>",self.right_menu_event) text.bind("<3>",self.right_menu_event)
text.bind("<<cut>>", self.cut) text.bind("<<cut>>", self.cut)
text.bind("<<copy>>", self.copy) text.bind("<<copy>>", self.copy)

View File

@ -1547,6 +1547,14 @@ def main():
root.withdraw() root.withdraw()
flist = PyShellFileList(root) flist = PyShellFileList(root)
macosxSupport.setupApp(root, flist) macosxSupport.setupApp(root, flist)
if macosxSupport.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 enable_edit:
if not (cmd or script): if not (cmd or script):