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: remove noisy icons from class (module) browser
Type: enhancement Stage: test needed
Components: IDLE Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: terry.reedy Nosy List: kbk, markroseman, rhettinger, roger.serwy, terry.reedy
Priority: normal Keywords:

Created on 2015-09-13 23:44 by markroseman, last changed 2022-04-11 14:58 by admin.

File name Uploaded Description Edit
browser.png markroseman, 2015-09-13 23:44
Messages (5)
msg250589 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-13 23:44
Proposal for an alternative or perhaps replacement of both the code context extension, as well as the class browser (rooted at a particular file, not the path browser).

I'll direct your attention to the attached browser.png. On the right is IDLE's class browser window of On the left, I've got the same file loaded into TextMate. 

In the TextMate status bar, it shows you where you're currently located (here, in the __init__ function). When you click on that part of the status bar, it brings up a scrollable menu showing the structure of the file. I think it's easier to read than IDLE's, despite having more information (description of the parameters), thanks to reduction in 'chart junk'.

Downside of this approach is that you can't have a window along the side so you can navigate the code while seeing the class display. Though that might best be achieved if IDLE added a sidebar, rather than a true separate window.
msg250590 - (view) Author: Raymond Hettinger (rhettinger) * (Python committer) Date: 2015-09-14 00:14
I don't see anything that replaces Code Context.   That extension is priceless for people editing classes and methods that extend more than one screen.

ISTM, there are too many sweeping change proposals that seem to base on general look and feel but disregard how people actually use these tools.
msg250599 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2015-09-14 02:46
Adding function arguments to the module browser, misnamed Class Browser, is #20827.  That leaves removing the noisy icons from class and def entries (where they do not fit anyway), as the concrete appearance change proposal here.  Better to use the space for arguments.

Adding nested classes is #1612262 (9 years ago).  I just noticed that there is a 6 year old patch that needs to be reviewed.

The TextMate box has a checkmark at the current location. Having an editor know about an attached module browser and inform it of the cursor's location would be a separate issue. It would be relatively easy when code context is active.  But nested classes and functions cannot be marked until they are displayed.

A module browser, even enhanced to display nested classes and functions, could not replace code context since the latter includes nested compound statements within functions.  I think code context would be even more useful if it were to display the complete context, using as many lines as needed, instead of some fixed number.  But I have not written a patch yet or opened an issue.
msg250669 - (view) Author: Mark Roseman (markroseman) * Date: 2015-09-14 15:03
Thanks Raymond. As an 'outsider' I rely on people like you to provide feedback based on your experience to some of the proposals I'm floating here. 

On a more specific note... 

This one came about mainly as I was looking at the class (module) browser. I thought it a bit limited/clunky, which as Terry noted has been brought up before. I noticed many editors/IDEs do a status bar thing showing current class and/or function, often as a gateway to navigating through the structure. I've found it a convenient and compact navigational cue/tool. I've also seen this used in addition to or in conjunction with a sidebar showing the file structure, highlighting current location. 

I've admittedly only briefly tried Code Context (and personally based on that limited experience didn't find it particularly helpful, and somewhat visually disruptive), and the mention here was almost an afterthought (since the status bar thing does provide a coarse level of context). I'd actually be curious to see how other editors/IDEs implement the same sort of feature as there may be some nice tweaks to steal - do you have any pointers?

Again, I greatly appreciate the feedback. In regards to your comment on "too many sweeping change proposals" I'd certainly like to hear any suggestions you may have around process, general concerns, etc.  Thanks again.
msg302818 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2017-09-23 23:11
I merged the nested functions and classes patch yesterday, so I really want to stop using file and folder icons for functions and classes.

However, this is not as easy as I was hoping.  By default, tree.TreeItem.GetIconName returns None.  tree.TreeNode then uses the default closed and open folder icons for contracted and expanded nodes.  There is no provision for 'no icon'.  The text print function hardcodes space for the icon.  The one thing I tried worked with module browser for at least a few node, but sent pathbrowser into a do-nothing state, probably a loop.

I decided to let this sit longer.  I hope to soon replace at least the low level part of tree (TreeNode) with ttk.Treeview, which does not require icons.
Date User Action Args
2022-04-11 14:58:20adminsetgithub: 69277
2017-09-23 23:11:37terry.reedysetmessages: + msg302818
2017-09-23 21:26:56terry.reedylinkissue31461 dependencies
2017-06-19 20:41:14terry.reedysetassignee: terry.reedy
stage: test needed
versions: + Python 3.7, - Python 2.7, Python 3.5
2015-09-14 15:03:04markrosemansetmessages: + msg250669
2015-09-14 02:46:51terry.reedysetmessages: + msg250599
title: IDLE: alternative to class browser / code context -> IDLE: remove noisy icons from class (module) browser
2015-09-14 00:14:44rhettingersetnosy: + rhettinger
messages: + msg250590
2015-09-13 23:44:39markrosemancreate