Is it possible to scroll Treeview's column con

2019-07-20 13:46发布

问题:

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, 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, 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.