Skip to content

IDLE only customizes correctly for OS X when using framework build #61854

Closed

Description

@rovitotv
mannequin
BPO 17654
Nosy @terryjreedy, @ronaldoussoren, @ned-deily, @serwy, @rovitotv
Files
  • issue17654.patch
  • 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/ned-deily'
    closed_at = <Date 2014-03-28.04:07:20.148>
    created_at = <Date 2013-04-08.00:14:55.947>
    labels = ['expert-IDLE', 'type-bug']
    title = 'IDLE only customizes correctly for OS X when using framework build'
    updated_at = <Date 2014-03-28.04:07:20.147>
    user = 'https://github.com/rovitotv'

    bugs.python.org fields:

    activity = <Date 2014-03-28.04:07:20.147>
    actor = 'ned.deily'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2014-03-28.04:07:20.148>
    closer = 'ned.deily'
    components = ['IDLE']
    creation = <Date 2013-04-08.00:14:55.947>
    creator = 'Todd.Rovito'
    dependencies = []
    files = ['34018']
    hgrepos = []
    issue_num = 17654
    keywords = ['patch']
    message_count = 9.0
    messages = ['186257', '186258', '186500', '210820', '210823', '215007', '215010', '215016', '215017']
    nosy_count = 6.0
    nosy_names = ['terry.reedy', 'ronaldoussoren', 'ned.deily', 'roger.serwy', 'Todd.Rovito', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue17654'
    versions = ['Python 2.7', 'Python 3.4', 'Python 3.5']

    Activity

    1. rovitotv commented on Apr 8, 2013

      rovitotvmannequin
      MannequinAuthor

      IDLE's new right click menu doesn't seem to be working on Mac OS X. I am running OS X 10.8.3 with TK version 8.5.9 (which I think is what OS X 10.8.3 ships with). The right click activation I am trying is control-click.

    2. ned-deily commented on Apr 8, 2013

      @ned-deily
      Member

      It works OK as long as you are running Python from a framework build (--enable-framework). There are various OS X customizations in IDLE that are currently triggered by the runningAsOSXApp() function in idlelib/macosxSupport.py. One of the customizations is to add the event binding for <Control-Button-1> (in idle lib/EditorWindow.py). Restricting the customizations to framework builds is not useful nor correct and there are some other questionable customizations assumptions made in that module. I'll work up a patch. In the meantime, you can easily workaround it for testing by patching runningAsOSXApp to always return True.

    3. changed the title [-]IDLE: Right click menu not working on OS X[/-] [+]IDLE only customizes correctly for OS X when using framework build[/+] on Apr 8, 2013
    4. self-assigned this
      on Apr 8, 2013
    5. ronaldoussoren commented on Apr 10, 2013

      @ronaldoussoren
      Contributor

      The trigger for the customizations is probably too specific. The primary reason for a having a check that's more specific than 'if sys.platform == "darwin"' is to avoid using the customizations when someone uses an X11 build of Tk and I didn't know (and still don't) a way to check for a "native" Tk port.

    6. ned-deily commented on Feb 10, 2014

      @ned-deily
      Member

      Here's a patch that refactors many of the OS X customizations in IDLE based on more granular criteria, e.g. those that should apply to all Tk implementations vs those that depend on specific ones (Cocoa Tk, Carbon Tk, or X11 Tk) rather than the bogus current framework test. This should fix the specific problem of the control-click menu not appearing in non-framework builds along with various other issues such as missing menu items when using an X11 Tk on OS X. It does not address the issue of providing the OS X specific key set with a non-framework build: bpo-20580 addresses that.

    7. ned-deily commented on Feb 10, 2014

      @ned-deily
      Member

      (Just to be clear, the Tk situation on OS X has changed substantially since the original customizations were added by Ronald. So the checks weren't bogus initially. And I've modified some of them subsequently before understanding some of the "nuances" of the various Tk implementations.)

    8. ned-deily commented on Mar 27, 2014

      @ned-deily
      Member

      If there are no objections, I'd like to commit this cleanup soon. It should make things a bit easier for people testing IDLE from development builds on OS X and fix some long-standing bugs when linking with the Tk X11 variant on OS X.

    9. terryjreedy commented on Mar 28, 2014

      @terryjreedy
      Member

      If I understand the Bindings.py patch, the fragility changed from "If you edit menudefs, edit the Mac block that follows" to "If you change (e sections of) menudefs, edit macosxSupport.overrideRootMenu". That seems like a wash to me, except for the narrowing down of which sections might later be patched.

      Every thing else that is not a change to macosSupport is guarded by macosSupport.xxx or 'darwin', so none from me.

    10. python-dev commented on Mar 28, 2014

      python-devmannequin
      Mannequin

      New changeset f551740c26b6 by Ned Deily in branch '2.7':
      Issue bpo-17654: Ensure IDLE menus are customized properly on OS X for
      http://hg.python.org/cpython/rev/f551740c26b6

      New changeset 67a7a49e7b78 by Ned Deily in branch '3.4':
      Issue bpo-17654: Ensure IDLE menus are customized properly on OS X for
      http://hg.python.org/cpython/rev/67a7a49e7b78

      New changeset d8659dbebfd1 by Ned Deily in branch 'default':
      Issue bpo-17654: merge from 3.4
      http://hg.python.org/cpython/rev/d8659dbebfd1

    11. ned-deily commented on Mar 28, 2014

      @ned-deily
      Member

      Thanks for the review, Terry. The reasons for moving the menders changes are two. As noted in the comments, the menudefs were being customized early in IDLE initialization before calling Tk to create the root object and, therefore, we did not know at that point which kind of Tk we were running under. To properly customize, we need to know that, as we are now more careful to customize menus depending on the OS X Tk variant. Also, there already were other menu customizations being done in macosxSupport; now it is all in one place. It would be nice to reduce the fragility in the menu management. I would encourage anyone interested in working on IDLE to tackle it as a separate issue.

      Applied for release in 3.5.0, 3.4.1, and 2.7.7.

    12. 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

    topic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions