# HG changeset patch # User Ned Deily # Date 1289608903 28800 # Branch release27-maint # Node ID 446348a11ed603f4593396c73e29f951d963aa4e # Parent c16daf15076584b2862d9b10ae11f2ae5eec9ec8 Issue10404 - IDLE on OS X popup menus do not work: cannot set/clear breakpoints In several contexts, IDLE binds clicking of the right mouse button to context popup menus, most importantly, to provide the Set Breakpoint and Clear Breakpoint actions in edit windows. On OS X systems, however, one cannot assume there will be more than one (e.g. the left) mouse button. Further, Aqua Tk, the default on OS X, binds a right button if present to , rather than as with other Tk implementations and ignores bindings. The net effect is that there is currently no way to use IDLE's breakpoint facility with Aqua Tk, with or without a multi-button mouse. Solution: On OS X, bind popup menus to Control-Click (of the main "left" button), as is commonly done elsewhere in OS X. Applies: py3k (3.2), 3.1, 2.7 diff -r c16daf150765 -r 446348a11ed6 Lib/idlelib/EditorWindow.py --- Lib/idlelib/EditorWindow.py Mon Oct 25 13:47:02 2010 -0700 +++ Lib/idlelib/EditorWindow.py Fri Nov 12 16:41:43 2010 -0800 @@ -136,6 +136,14 @@ 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) @@ -154,7 +162,6 @@ 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)