I would like to have a treeview with all the elements anchored to the left, with no heading and with the little plus button that expands the subvalues. For some reason I dont get the three things to work at once.
Here's my code:
import tkinter as tk
from tkinter import ttk
list1 = ["N_1", "N_13", "N_17"]
list2 = ["N_8", "N_3", "N_5", "N_19"]
root = tk.Tk()
frame = tk.Frame(root)
frame.place(x=0, y=0, relwidth=1, relheight=1)
tree = ttk.Treeview(frame)
tree["show"] = "tree"
tree.place(x=0, y=0, relwidth=1, relheight=1)
tree['columns'] = ["Col1"]
tree.column("Col1", anchor='w') #n, ne, e, se, s, sw, w, nw, or center
tree.insert("", "end" , values= "Num1")
for i in list1:
tree.insert("", "end" , values= i)
id = tree.insert("", "end")
for i in list2:
tree.insert(id, "end", values=i)
root.mainloop()
If you change the show attribute to "headings"