How to create custom drawn columns in or alongside tree view?

Viewed 21

A picture is worth 1000 words, so here is what I am trying to achieve:

Desired Result

In words, I would like to add a column to a tree view in which I can draw vertical connecting lines between certain rows of the tree view. This should work both when the tree view is scrolled, as well as when children of a row are expanded or collapsed.

First question: Is it at all feasible to do this within a ttk.Treeview? Since a tree view brings along all the additional functionality that I need, specifically for everything to the right of the connections column, I would prefer making use of it.

If not possible completely within a ttk.Treeview, how could I keep a separate canvas widget to the left of the tree view in sync with the tree view (row height, scroll position, collapsed/expanded children)?

Finally, if even keeping a canvas in sync with a tree view is not feasible, do you have an alternative suggestion regarding widgets and layouts in order to achieve this. Are there examples of using a grid layout to mimic the functionality of a tree view (expandable children, resizable columns)?

0 Answers
Related