diff options
author | R. David Murray <rdmurray@bitdance.com> | 2010-12-18 17:19:10 (GMT) |
---|---|---|
committer | R. David Murray <rdmurray@bitdance.com> | 2010-12-18 17:19:10 (GMT) |
commit | b68a7bc70c74d96eb1aa448629e3c3875ab206e6 (patch) | |
tree | 0af42cdc19c30671232254e8a9672df4a246f5b5 /Lib/idlelib | |
parent | 5466bf1c94d38e75bc053b0cfc163e2f948fe345 (diff) | |
download | cpython-b68a7bc70c74d96eb1aa448629e3c3875ab206e6.zip cpython-b68a7bc70c74d96eb1aa448629e3c3875ab206e6.tar.gz cpython-b68a7bc70c74d96eb1aa448629e3c3875ab206e6.tar.bz2 |
#10404: Use ctl-button-1 for context menus on OSX Idle.
This provides access to the context menus where they previously could
not be accessed due to the way OSX Tk binds buttons. It also
improves platform consistency.
Patch by Ned Deily.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r-- | Lib/idlelib/EditorWindow.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index a634962..a06c341 100644 --- a/Lib/idlelib/EditorWindow.py +++ b/Lib/idlelib/EditorWindow.py @@ -138,6 +138,14 @@ class EditorWindow(object): if macosxSupport.runningAsOSXApp(): # Command-W on editorwindows doesn't work without this. text.bind('<<close-window>>', self.close_event) + # Some OS X systems have only one mouse button, + # so use control-click for pulldown menus there. + # (Note, AquaTk defines <2> as the right button if + # present and the Tk Text widget already binds <2>.) + text.bind("<Control-Button-1>",self.right_menu_event) + else: + # Elsewhere, use right-click for pulldown menus. + text.bind("<3>",self.right_menu_event) text.bind("<<cut>>", self.cut) text.bind("<<copy>>", self.copy) text.bind("<<paste>>", self.paste) @@ -156,7 +164,6 @@ class EditorWindow(object): text.bind("<<find-selection>>", self.find_selection_event) text.bind("<<replace>>", self.replace_event) text.bind("<<goto-line>>", self.goto_line_event) - text.bind("<3>", self.right_menu_event) text.bind("<<smart-backspace>>",self.smart_backspace_event) text.bind("<<newline-and-indent>>",self.newline_and_indent_event) text.bind("<<smart-indent>>",self.smart_indent_event) |