Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE: click on context line should jump to line, at top of window #77949

Closed
terryjreedy opened this issue Jun 4, 2018 · 6 comments
Closed

IDLE: click on context line should jump to line, at top of window #77949

terryjreedy opened this issue Jun 4, 2018 · 6 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 33768
Nosy @terryjreedy, @csabella, @miss-islington
PRs
  • bpo-33768: IDLE: Clicking on code context line moves it to top of editor #7411
  • [3.7] bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411) #7515
  • [3.6] bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411) #7516
  • Dependencies
  • bpo-33763: IDLE: Use text widget for code context instead of label widget
  • 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/terryjreedy'
    closed_at = <Date 2018-06-08.05:51:45.812>
    created_at = <Date 2018-06-04.05:54:31.834>
    labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: click on context line should jump to line, at top of window'
    updated_at = <Date 2018-06-08.05:51:45.811>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2018-06-08.05:51:45.811>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = True
    closed_date = <Date 2018-06-08.05:51:45.812>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2018-06-04.05:54:31.834>
    creator = 'terry.reedy'
    dependencies = ['33763']
    files = []
    hgrepos = []
    issue_num = 33768
    keywords = ['patch']
    message_count = 6.0
    messages = ['318636', '318702', '318710', '319019', '319021', '319022']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'cheryl.sabella', 'miss-islington']
    pr_nums = ['7411', '7515', '7516']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue33768'
    versions = ['Python 3.6', 'Python 3.7', 'Python 3.8']

    @terryjreedy
    Copy link
    Member Author

    Item 8. on bpo-33610. Clicking on a line in the context box jumps the editor to that line, displayed as the first line. If we do item 11, replace Label with Text, this has to start after bpo-33763 is merged.

    We could determine the context line clicked from click event.y by using .dlineinfo('1.0') on the editor window to get the offset and height of textlines for the font used.

    Disabled texts still have an 'insert' mark that is moved by clicks. It is just not visible. The line clicked on is int(self.context.index('insert').split('.')[0]),
    or int(float(index('insert'))),
    or next(map(int, t.index('insert').split('.'))),
    or s=t.index('insert'); int(s[:s.find('.')])
    the same as if the context were 'normal' with a visible cursor.

    This only works if the default click handler fires first, so the mark is moved before we look at it. The default handler is a class binding to Button (press), so we should just be able to bind to ButtonRelease, which is generally a better choice anyway "because if the user accidentally presses the button, they can move the mouse off the widget to avoid setting off the event."

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes labels Jun 4, 2018
    @terryjreedy terryjreedy self-assigned this Jun 4, 2018
    @terryjreedy terryjreedy added topic-IDLE type-feature A feature request or enhancement labels Jun 4, 2018
    @csabella
    Copy link
    Contributor

    csabella commented Jun 4, 2018

    I'll try to have a PR for this by later today.

    @terryjreedy
    Copy link
    Member Author

    Great. I might try some timing experiments later. I have seen both of the first 2 options above in use.

    @terryjreedy
    Copy link
    Member Author

    New changeset 041272b by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
    bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
    041272b

    @miss-islington
    Copy link
    Contributor

    New changeset a486847 by Miss Islington (bot) in branch '3.7':
    bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
    a486847

    @miss-islington
    Copy link
    Contributor

    New changeset 1038669 by Miss Islington (bot) in branch '3.6':
    bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
    1038669

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants