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: Tree lines are spaced too close together.
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.4, Python 3.5, Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder: IDLE: Convert browsers to use ttk.Treeview
View: 31552
Assigned To: terry.reedy Nosy List: Al.Sweigart, Saimadhav.Heblikar, exarkun, python-dev, terry.reedy
Priority: normal Keywords: patch

Created on 2014-10-14 03:09 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

File name Uploaded Description Edit
atree.diff terry.reedy, 2014-10-14 03:09 review
Messages (5)
msg229277 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-10-14 03:09
(Mentioned on #16233) At least on my windows 7 system, the lines of idlelib.TreeWidget, used for Path Browser and Class (Module) Browser, are spaced too narrowly.  They are so close together that they overlap and each cuts off enough of the line above to make reading difficult.

TreeWidget is actually a canvas painted with icons, connecting lines, and lines of text. There is no automatic spacing of text lines as with tkinter.Text.  A comment in the draw method notes "XXX This hard-codes too many geometry constants!".

The attached patch changes two of the constants.  Increasing dy spreads the line apart a bit so there is very little clipping. (Both g and y are sometimes complete, sometimes not.) The other change moves the lines up relative to the icons so they are not offset.

Saimadhav, does this change look ok on linux?

I think the long term fix (before 3.5) is to use ttk.Treeview.  So I am not inclined to spend lots of time fine-tuning on various systems or adding user configuration (though we might for Treeview).  However, dy could be made conditional on, for instance, sys.platform[0:3] == 'win'.
msg229532 - (view) Author: Saimadhav Heblikar (Saimadhav.Heblikar) * Date: 2014-10-16 14:09
It does not change anything else other than the intended, so looks OK on linux.
msg229563 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-17 03:13
New changeset aa447531490d by Terry Jan Reedy in branch '2.7':
Issue #22628: Increase Treewidge line spacing so lines do not overlap.

New changeset ffe4f3694c0f by Terry Jan Reedy in branch '3.4':
Issue #22628: Increase Treewidge line spacing so lines do not overlap.

New changeset 7ee79c3d4f5f by Terry Jan Reedy in branch 'default':
Merge with 3.4 Issue #22628
msg415495 - (view) Author: Jean-Paul Calderone (exarkun) * (Python committer) Date: 2022-03-18 13:26
This is still/again broken, probably because the "fixed" version still hard-codes all of the geometry values and these will certainly not be correct for all combinations of display dpi, font configuration, etc.

Instead, `TreeNode.draw` and `TreeNode.drawtext` (at least) need to consider the size of the children and space them accordingly.
msg415507 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2022-03-18 15:44
We started using ttk widgets in 3.6.  As I said above, the real solution should be to use ttk.Treeview.  This is issue 31552.
Date User Action Args
2022-04-11 14:58:09adminsetgithub: 66818
2022-03-18 15:44:13terry.reedysetstatus: open -> closed

superseder: IDLE: Convert browsers to use ttk.Treeview
resolution: fixed
messages: + msg415507
2022-03-18 13:26:06exarkunsetstatus: closed -> open

nosy: + exarkun
messages: + msg415495

resolution: fixed -> (no value)
2015-01-04 02:44:14Al.Sweigartsetnosy: + Al.Sweigart
2014-10-17 03:14:29terry.reedysetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2014-10-17 03:13:50python-devsetnosy: + python-dev
messages: + msg229563
2014-10-16 14:09:04Saimadhav.Heblikarsetmessages: + msg229532
2014-10-14 03:10:02terry.reedysetcomponents: + IDLE
2014-10-14 03:09:38terry.reedycreate