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.

classification
Title: IDLE: Use text widget for code context instead of label widget
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.8, Python 3.7, Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: cheryl.sabella, miss-islington, terry.reedy
Priority: normal Keywords: patch

Created on 2018-06-04 00:11 by cheryl.sabella, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 7367 merged cheryl.sabella, 2018-06-04 00:15
PR 7399 merged miss-islington, 2018-06-04 15:59
PR 7400 merged miss-islington, 2018-06-04 16:00
Messages (7)
msg318588 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-06-04 00:11
Item 11 from #33610.
Use read-only Text instead of Label for context. 

* Change widget type from Label to Text and remove Label-only arguments.
* Add height and state arguments.
* Change widget name from self.label to self.context.
* Tests: change widget name and method for getting text.
msg318637 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-04 06:07
This makes detecting the context line a user clicks on slightly easier.  See new issue #33768 for discussion.  I am not sure now I would do this just for this reason, without trying with the label first.

Using a text also allows us to experiment with tagging the context keyword somehow, to see if it seems like an improvement.  Perhaps make it bold, or underlined, or the normal keyword color, or some variant thereof (grayed?).

So I am inclined to go ahead.  I did notice that most of the patch is straightforward substitution.  To me, this suggests that the code is pretty good.  Also, I think change 'label' (implentation) to 'context' (purpose) is a good change by itself.  I would keep this even if we reverted to using Label.
msg318646 - (view) Author: Cheryl Sabella (cheryl.sabella) * (Python committer) Date: 2018-06-04 12:37
To your point, when I was adding the colors to configuration for context, I wondered if having context as a text widget could somehow use the colorizer.  I didn't really look into it, but it did seem like it might make sense to keep all the foreground text colors the same as they are in the editor.
msg318663 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-04 15:58
New changeset b609e687a076d77bdd687f5e4def85e29a044bfc by Terry Jan Reedy (Cheryl Sabella) in branch 'master':
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
https://github.com/python/cpython/commit/b609e687a076d77bdd687f5e4def85e29a044bfc
msg318669 - (view) Author: miss-islington (miss-islington) Date: 2018-06-04 16:22
New changeset ffe29dbcd96dc2fbda212f8335908fa1bc8ed893 by Miss Islington (bot) in branch '3.6':
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
https://github.com/python/cpython/commit/ffe29dbcd96dc2fbda212f8335908fa1bc8ed893
msg318670 - (view) Author: miss-islington (miss-islington) Date: 2018-06-04 16:33
New changeset b7eb1024d06e51598fc8a19ed6e22b91120c6a1e by Miss Islington (bot) in branch '3.7':
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
https://github.com/python/cpython/commit/b7eb1024d06e51598fc8a19ed6e22b91120c6a1e
msg318676 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2018-06-04 17:02
I believe the colorizer would need some new code, maybe in a subclass, but it should be possible.  I would not know if I liked it until we tried it ;-).
History
Date User Action Args
2022-04-11 14:59:01adminsetgithub: 77944
2018-06-04 17:02:38terry.reedysetstatus: open -> closed
resolution: fixed
messages: + msg318676

stage: patch review -> resolved
2018-06-04 16:33:27miss-islingtonsetmessages: + msg318670
2018-06-04 16:22:14miss-islingtonsetnosy: + miss-islington
messages: + msg318669
2018-06-04 16:00:57miss-islingtonsetpull_requests: + pull_request7026
2018-06-04 15:59:54miss-islingtonsetpull_requests: + pull_request7025
2018-06-04 15:58:47terry.reedysetmessages: + msg318663
2018-06-04 12:37:32cheryl.sabellasetmessages: + msg318646
2018-06-04 06:07:29terry.reedysetmessages: + msg318637
2018-06-04 05:55:37terry.reedylinkissue33768 dependencies
2018-06-04 00:17:45cheryl.sabellalinkissue33610 dependencies
2018-06-04 00:15:46cheryl.sabellasetkeywords: + patch
stage: patch review
pull_requests: + pull_request6993
2018-06-04 00:11:28cheryl.sabellacreate