Can CheckboxTreeView create horizontal CheckButtons?

63 Views Asked by At

I am trying to use CheckboxTreeView from ttkWidgets and so far I am able to create Checkbuttons using the insert command. However, the number of check buttons are pretty lengthy (got about 30 of them ). I would like to have them horizontally stacked ( 5 per row ) so that the number of lines of checkbuttons are reduced to 6.

Is there anyway of doing this? I don't see the option of stacking buttons horizontally in CheckboxTreeView.

Thanks

I have tried grid as well as inserting Checkbutton inside "CheckboxTreeView". I have no success.

Here is my code :

from ttkwidgets import CheckboxTreeview, Table
import tkinter as tk
from tkinter import IntVar
 
root = tk.Tk()
 
tree = CheckboxTreeview(root)
tree.pack()
t = Table(root, drag_cols=True, drag_rows=True)
 
tree.insert("", "end", "1", text="1", values = ('1','2'))    
tree.insert("1", "end", "11", text="11")    
tree.insert("1", "end", "12",  text="12")    
tree.insert("1", "end", "13",  text="13")    
tree.insert("1", "end", "14",  text="14") 
tree.insert("1", "end", "15",  text="15")    
tree.insert("1", "end", "16",  text="16")    
tree.insert("1", "end", "17",  text="17")    
tree.insert("1", "end", "18",  text="18")    
tree.insert("1", "end", "19",  text="19")    
tree.insert("1", "end", "20",  text="20")    
tree.insert("1", "end", "21",  text="21")    
 
root.mainloop()

Is there a way to make these Checkbuttons horizontally aligned?

0

There are 0 best solutions below