Replies: 3 comments 1 reply
-
Yes, you can increase the row height, but you'll need to create a style for it. You can do that by subclassing the existing style and adjusting the import ttkbootstrap as ttk
from ttkbootstrap.constants import *
from random import choice, randint
window = ttk.Window()
window.style.configure('my.Treeview', rowheight=40)
tv = ttk.Treeview(style='my.Treeview', columns=(0, 1, 2))
# add some generic columns
for i, lbl in enumerate(['Name', 'Age', 'Occupation']):
tv.heading(i, text=lbl)
# add some groups
for i in range(4):
tv.insert('', END, i, text=f'Group {i}')
# add some random records for each group
for i in range(4):
for j in range(3):
name = choice(['Phillipe', 'Max', 'Antony', 'Tina', 'Alexa'])
age = randint(25, 60)
occupation = choice(['Developer', 'Accountant', 'Nurse', 'Secretary'])
tv.insert(i, END, values=(name, age, occupation))
tv.pack(fill=X, expand=YES)
window.mainloop() The only way to change the size of the indicator is to create and map new assets to the various indicator states within the style. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello all,
I have just started to use ttkbootstrap and my projects typically use a lot of treeview widgets. I am wondering if there is a way to increase the row height for a treeview widget?
This may be solved by the first question but I am also looking to increase the size of the parent open icon, right now it is very small, and im not getting the box around the icon either. This may be a coloring issue but I haven't been able to figure it out quite yet. The ttkcreator does not seem to show the treeview when creating, just a tableview.
Any ideas would be appreciated!
Beta Was this translation helpful? Give feedback.
All reactions