From: R. David Murray Date: Sat, 18 Dec 2010 17:19:10 +0000 (+0000) Subject: #10404: Use ctl-button-1 for context menus on OSX Idle. X-Git-Tag: v3.2b2~16 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b68a7bc70c74d96eb1aa448629e3c3875ab206e6;p=python #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. --- diff --git a/Lib/idlelib/EditorWindow.py b/Lib/idlelib/EditorWindow.py index a634962375..a06c341be8 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('<>', 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("",self.right_menu_event) + else: + # Elsewhere, use right-click for pulldown menus. + text.bind("<3>",self.right_menu_event) text.bind("<>", self.cut) text.bind("<>", self.copy) text.bind("<>", self.paste) @@ -156,7 +164,6 @@ class EditorWindow(object): text.bind("<>", self.find_selection_event) text.bind("<>", self.replace_event) text.bind("<>", self.goto_line_event) - text.bind("<3>", self.right_menu_event) text.bind("<>",self.smart_backspace_event) text.bind("<>",self.newline_and_indent_event) text.bind("<>",self.smart_indent_event) diff --git a/Misc/NEWS b/Misc/NEWS index 020ddd1000..456b1ef40d 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -23,7 +23,9 @@ Core and Builtins Library ------- -- Issue $9907: Fix tab handling on OSX when using editline by calling +- Issue #10404: Use ctl-button-1 on OSX for the context menu in Idle. + +- Issue #9907: Fix tab handling on OSX when using editline by calling rl_initialize first, then setting our custom defaults, then reading .editrc. - Issue #4188: Avoid creating dummy thread objects when logging operations