Recently, I use tkinter TreeView to show many columns in Python. Specifically, 49 columns data in a treeview. I use grid to manage my widgets.
I found out the width of the treeview only depends on the width of columns.
My question is, How can I set the width of the Treeview. (The default width is the summation of all columns' width)
When all my column width is set as 20. This is 49 columns. :)

Here is my main code :
frame = Frame(self.master, width = 1845, height = 670)
frame.place(x = 20, y = 310)
tree_view = Treeview(frame, height = 33, selectmode = "extended")
for i in range(len(id_list)):
tree_view.column(id_list[i], width = width_list[i], anchor = CENTER)
tree_view.heading(id_list[i] , text = text_list[i])
tree_view["show"] = "headings"
# Omit the declaration of scrollbar
tree_view['yscroll'] = self.y_scollbar.set
tree_view['xscroll'] = self.x_scollbar.set
tree_view.grid(row = 0, column = 0, sticky = NSEW)
for item in detail_info_list:
tree_view.insert("",0, text = str(item.id), value=(...))
id_list,width_list,text_list is used to store columns information.
detail_info_list is to store the data showed in the Treeview.
My target is when I define a large width(for example: 3000) of some column, my treeview could show the data as I expected. But the treeview is across my screen and the horizontal scrollbar also can't slide.
When 17th column is set as 1500:

I can't see my buttons, and I can't slide the horizontal scrollbar.
Also, I have tried some solution.
- Define a frame to be the Treeview parent. And define the width and height to constraint the Treeview. But it didn't work.
- I looked up some documents and search for this question. I don't find any solution to set the width as a constant number.