Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I set the row height in Tkinter TreeView?

I wrote a small app recently that needs to be cross-platform. I used Python and Tkinter for the GUI.

It works great but recently I got a new laptop with a hiDPI screen and it seems to mess up the TreeView (see image below). The text height is too big compared to the height of the rows.

The picture is taken from a virtual machine running Windows 7 as a guest. I had to set the text to a larger size (125%) to be able to read on the screen (every other program I've tried work fine with this setting).

Is there any way to set the height of a row in Tkinter TreeView? I haven't seen anything like that in the docs.

enter image description here

like image 717
Jacques Gaudin Avatar asked Dec 18 '22 01:12

Jacques Gaudin


1 Answers

s = ttk.Style()
s.configure('Treeview', rowheight=40) # repace 40 with whatever you need
like image 94
Novel Avatar answered Dec 27 '22 00:12

Novel