I want to know how height (in pixel) is a row in a tkinter.Treeview
. I know how I can manipulate the height (see example below) with the styling mechanism. But I want to read it first - because it depends on the operating system, fonts, etc. And I couldn't find something in the style object I could read for this.
#!/usr/bin/env python3
from tkinter import *
from tkinter import ttk
if __name__ == '__main__':
root = Tk()
style = ttk.Style()
# here I set the `rowheight`
style.configure('MyTreeView.Treeview', rowheight=45)
tree = ttk.Treeview(root, style='MyTreeView.Treeview')
tree.pack()
for i in range(5):
tree.insert(parent='',
index=END,
text='item {}'.format(i))
root.mainloop()