How to change height of only one row in a Treeview?

不羁的心 提交于 2021-01-29 21:57:57

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!