Skip to content

CTkTreeView

Rudy edited this page Feb 21, 2024 · 1 revision

Preview

ctk_Treeview_1 ctk_Treeview_2

Example usage

# CTkTreeView
data = [
    {
        'name': 'Item 1',
        'children': ['Subitem 1', 'Subitem 2', {"name": "Subitem 3", "children": ["Sub-subitem 1", "Sub-subitem 2"]}]
    },
    'Item 2',
    {
        'name': 'Item 3',
        'children': ['Subitem 3']
    }
]
tree_view = CTkTreeView(master=app, items=data) # This will create a tree view with the specified data.
tree_view.pack(pady=20, padx=20, fill="both", expand=True) # This will pack the tree view into the app.

Arguments

CTkTreeView

Parameter Description
master Set parent window
items The data or items should be inserted to treeview, takes lists and dict

Clone this wiki locally