问题
I'm creating a Tkinter-based GUI in Python, and I can't find out how to change the height of only one row. I've tried this code, but it changes height of every row.
from tkinter import *
from tkinter.ttk import *
root = Tk()
Style(root).configure("Treeview", rowheight=40)
tree = Treeview(root, style="Treeview")
tree.pack()
for i in range(100):
tree.insert("", END, i, text=str(i) * i)
root.mainloop()
I've also tried to use the style for certain tags, but it doesn't work. How can I do what I need?
回答1:
How to change height of only one row in a Treeview?
I don't think you can change the height of a single row. The treeview was designed to have uniform rows.
来源:https://stackoverflow.com/questions/61107432/how-to-change-height-of-only-one-row-in-a-treeview