Oliver Scholl
Oliver Scholl

Reputation: 63

Treeview: How to change rowheight of title row

I'm able to change the rowheight of the normal rows of ttk::treeview with

ttk::style configure MyStyle.Treeview -rowheight 25

But this command doesn't change the rowheight of the title row. How can I do this?

Upvotes: 0

Views: 164

Answers (2)

Brad Lanam
Brad Lanam

Reputation: 5723

There does appear to be any way to change the height of the heading.

The best you can do is to create a custom font and configure the treeview heading to use it.

'Heading' is the name of the treeview heading style.

font create headingfont
font configure headingfont -size 13
ttk::style configure Heading -font headingfont

Edit: Per Oliver Scholl's answer, you can use:

ttk::style configure Heading -padding {0 20}

This will set the top/bottom padding to 20 and the left/right padding to 0.

 -padding 20 ; # left/top/bottom/right all the same
 -padding {0 20} ; # left/right, top/bottom
 -padding {0 20 0 20} ; # left, top, right, bottom

Upvotes: 1

Oliver Scholl
Oliver Scholl

Reputation: 63

The solution is

ttk::style configure Treeview.Heading -padding "0 0 0 0"

or

ttk::style configure Treeview.Heading -padding {0 0 0 0}

The padding option is a list with the order {left top right bottom}.

Upvotes: 0

Related Questions