Skip to content

IDLE on OS X popup menus do not work: cannot set/clear breakpoints #54613

Closed

Description

@ned-deily
BPO 10404
Nosy @birkenfeld, @terryjreedy, @kbkaiser, @ronaldoussoren, @taleinat, @benjaminp, @ned-deily, @merwok, @bitdancer
Files
  • issue10404-idle_no_context_menus.txt
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/bitdancer'
    closed_at = <Date 2010-12-18.17:22:51.794>
    created_at = <Date 2010-11-13.08:39:21.048>
    labels = ['OS-mac', 'expert-IDLE', 'type-bug']
    title = 'IDLE on OS X popup menus do not work: cannot set/clear breakpoints'
    updated_at = <Date 2015-09-23.01:19:24.392>
    user = 'https://github.com/ned-deily'

    bugs.python.org fields:

    activity = <Date 2015-09-23.01:19:24.392>
    actor = 'terry.reedy'
    assignee = 'r.david.murray'
    closed = True
    closed_date = <Date 2010-12-18.17:22:51.794>
    closer = 'r.david.murray'
    components = ['IDLE', 'macOS']
    creation = <Date 2010-11-13.08:39:21.048>
    creator = 'ned.deily'
    dependencies = []
    files = ['19592']
    hgrepos = []
    issue_num = 10404
    keywords = []
    message_count = 15.0
    messages = ['121118', '121119', '121851', '121852', '121938', '123559', '123572', '123594', '123595', '123596', '124244', '124296', '124298', '251383', '251385']
    nosy_count = 10.0
    nosy_names = ['georg.brandl', 'terry.reedy', 'kbk', 'ronaldoussoren', 'taleinat', 'benjamin.peterson', 'ned.deily', 'eric.araujo', 'r.david.murray', 'Bruce.Sherwood']
    pr_nums = []
    priority = 'critical'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue10404'
    versions = ['Python 3.1', 'Python 2.7', 'Python 3.2']

    Activity

    1. ned-deily commented on Nov 13, 2010

      @ned-deily
      MemberAuthor

      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 <Button-2>, rather than <Button-3> as with other Tk implementations and ignores <Button-3> 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.

    2. ned-deily commented on Nov 13, 2010

      @ned-deily
      MemberAuthor

      The attached patch modifies IDLE on OS X to bind popup menus to Control-Click (of the main or "left" button), as is commonly done elsewhere in OS X.

    3. merwok commented on Nov 21, 2010

      @merwok
      Member

      Platform consistency is a worthy criterion for changes, but I suspect such a behavior change can’t make it into stable branches.

    4. ned-deily commented on Nov 21, 2010

      @ned-deily
      MemberAuthor

      IMO, it's not s behavior change, it's a serious bug in the OS X version as released in the python.org installer. Important functionality is broken.

    5. merwok commented on Nov 21, 2010

      @merwok
      Member

      Apologies, I had misread your message: I thought the keybinding was wrong but working. Your fix should be committed.

    6. ronaldoussoren commented on Dec 7, 2010

      @ronaldoussoren
      Contributor

      The patch binds the menu to Ctrl-Button-1 (that is, the way you open context menu's on OSX systems with a single button), however rightclick still doens't work (but does an X11-style paste operation).

      I propose adding an explicit binding for button-2 as well:

                  text.bind("<Control-Button-1>",self.right_menu_event)
                  text.bind("<Button-2>",self.right_menu_event)

      This ensures that the context menu can be opened using the expected mouse button.

      An IMO additional bonus is that the odd X11-style pasting behaviour is disabled (that is, right-click is no longer equivalent to Cmd-V), although one could claim that this breaks backward compatibility.

    7. ned-deily commented on Dec 7, 2010

      @ned-deily
      MemberAuthor

      Unfortunately, just adding the binding to <button-2> does not work because the Tk Text widget already has a documented binding of "paste-text" to <button-2> and this does not override that. With the binding added, I found that the button-2 behavior for breakpoints did not work correctly as both events would be triggered and the resulting breakpoint lines were incorrect. That, plus the compatibility issue, is why I thought it best to just stick to control-click.

    8. ronaldoussoren commented on Dec 8, 2010

      @ronaldoussoren
      Contributor

      Yet another prove of how much Tk sucks on OSX.

      I'm not too happy about only binding Ctrl+<button-1>, because users will expect that this is means that <button-2> works as well. But if we cannot disable the default <button-2> binding we'll have to live with this crap.

    9. ronaldoussoren commented on Dec 8, 2010

      @ronaldoussoren
      Contributor

      Oops, 's/prove/proof/'

    10. ned-deily commented on Dec 8, 2010

      @ned-deily
      MemberAuthor

      It could be worse. As I noted in bpo-10405, the IDLE breakpoint facility appears to be officially undocumented on any platform so it's hard to know what users' expectations are. And there are still Macs out there with only one button. As a side note, there are still OS X X11 versions of Tkinter for current Python releases; for example, the default MacPorts Tk configuration is X11-based; it does have the advantage of working without quirks in 64-bit builds.

    11. ned-deily commented on Dec 17, 2010

      @ned-deily
      MemberAuthor

      I think this should be applied for 3.2 (and 2.7 and 3.1). The risk is low and the benefit to OS X IDLE users is great, since without it there is no way to use IDLE's breakpoint facility.

    12. birkenfeld commented on Dec 18, 2010

      @birkenfeld
      Member

      Looks fine, David, do you want to commit?

    13. bitdancer commented on Dec 18, 2010

      @bitdancer
      Member

      Committed to py3k in r87374, 3.1 in r87375, and 2.7 in r87376.

    14. terryjreedy commented on Sep 23, 2015

      @terryjreedy
      Member

      Right click for context menu in Mac Aqua is fixed in #bpo-24570.

    15. terryjreedy commented on Sep 23, 2015

      @terryjreedy
      Member

      Sorry, bpo-24801.

    16. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions