May-25-2021, 11:01 AM
Hi,
************ reposting question as the the forum rules ***********
The code below creates a treeview and frame. Can someone help create some forms that will open in the frame when selecting a treeview node.
i.e when I select A in the treeview node, Form A is then called in the frame and so on....
How is this accomplished in python?
************ reposting question as the the forum rules ***********
The code below creates a treeview and frame. Can someone help create some forms that will open in the frame when selecting a treeview node.
i.e when I select A in the treeview node, Form A is then called in the frame and so on....
How is this accomplished in python?
from tkinter import * from tkinter import ttk root = Tk() root.title('Test') root.iconbitmap() PW = ttk.PanedWindow(root, orient=HORIZONTAL) PW.pack(fill=BOTH, expand=True) def my_cfm(): my_label = label(f2,bg=red) my_label.pack() f1 = ttk.Frame(PW, width=75, height=300, relief=SUNKEN) f2 = ttk.Frame(PW, width=400, height=300, relief=SUNKEN) PW.add(f1, weight=0) PW.add(f2, weight=4) tv = ttk.Treeview(f1) tv.pack() tv.insert('', '0', 'item1', text='PRODUCT') tv.insert('item1', '0', 'A', text='A') tv.insert('item1', '1', 'B', text='B') tv.insert('item1', '2', 'C', text='C') tv.insert('item1', '3', 'D', text='D') tv.insert('', '1', 'item2', text='REPORTS') tv.insert('', '3', 'item3', text='QUERIES') tv.config(height=100) root.state('zoomed') tv.mainloop()Thanks