This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Title: IDLE: click on context line should jump to line, at top of window
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.8, Python 3.7, Python 3.6
Status: closed Resolution: fixed
Dependencies: 33763 Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2018-06-04 05:54 by terry.reedy, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7411 merged cheryl.sabella, 2018-06-04 23:26
PR 7515 merged miss-islington, 2018-06-08 05:22
PR 7516 merged miss-islington, 2018-06-08 05:23
Messages (6)
msg318636 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-04 05:54
Item 8. on #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 #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."
msg318702 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-06-04 20:48
I'll try to have a PR for this by later today.
msg318710 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-04 21:50
Great.  I might try some timing experiments later.  I have seen both of the first 2 options above in use.
msg319019 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-08 05:21
New changeset 041272b657867f5bec925b19aabf23944125d49b 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)
msg319021 - (view) Author: miss-islington (miss-islington) Date: 2018-06-08 05:50
New changeset a4868473e7a0487bd882531490ff8856b952f9b3 by Miss Islington (bot) in branch '3.7':
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
msg319022 - (view) Author: miss-islington (miss-islington) Date: 2018-06-08 05:51
New changeset 1038669769208fc05c9a565fbf575f5fa8e9ef61 by Miss Islington (bot) in branch '3.6':
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
Date User Action Args
2022-04-11 14:59:01adminsetgithub: 77949
2018-06-08 05:51:45terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2018-06-08 05:51:01miss-islingtonsetmessages: + msg319022
2018-06-08 05:50:39miss-islingtonsetnosy: + miss-islington
messages: + msg319021
2018-06-08 05:23:25miss-islingtonsetpull_requests: + pull_request7144
2018-06-08 05:22:33miss-islingtonsetpull_requests: + pull_request7143
2018-06-08 05:21:23terry.reedysetmessages: + msg319019
2018-06-04 23:26:15cheryl.sabellasetkeywords: + patch
stage: test needed -> patch review
pull_requests: + pull_request7036
2018-06-04 21:50:35terry.reedysetmessages: + msg318710
2018-06-04 20:48:10cheryl.sabellasetmessages: + msg318702
2018-06-04 05:55:37terry.reedysetnosy: + cheryl.sabella
dependencies: + IDLE: Use text widget for code context instead of label widget
2018-06-04 05:54:31terry.reedycreate