5

I have a window with Treeview widget and a column. If I add enough nodes so that node's text extends beyond window's width, it'll not be possible to scroll horizontally unless I change column width to make it wider than the window width.

Here's what I mean:

I should be able to scroll horizontally so I can accomodate for the node's text.

I should be able to scroll horizontally so I can accomodate for the node's text, but the horizontal scroll bar is disabled.

However, if I manully resize the column itself, I'll be able to scroll until I reach the column's right border.

Notice that scrollbar accomodates for the column width, not the text.

Notice that scrollbar accomodates for the column width, not the text, the text was left behind.

self._tree_scrollbar_x = ttk.Scrollbar(self._tree_frame, orient='horizontal', command=self._tree.xview)
self._tree.configure(xscrollcommand=self._tree_scrollbar_x.set)
self._tree_scrollbar_x.grid(row=1, column=0, sticky=(tk.E, tk.W))

There is a resize property, but that only changes whether the column resizes automatically with the window frame/border.

I know this question has been asked before without a solid answer, so this just might be the limitation of Tkinter/Ttk.

Any help is greatly appreciated, thanks.

Doom8890
  • 435
  • 3
  • 15
  • maybe get the selected items width and whatever padding is used to move it off the left side and set width to that in a bind event ? – Scott Paterson Jun 13 '23 at 11:21

0 Answers0