Parent-child node □We can set the parent and child rows or nodes to the Treeview. '' : Neither tree view nor headings are shown. Tree headings : (Default) Show both heading and expanding child node. Tree: Show tree view with expanding the child node. show option: trv = 'tree' □ headings: Show the headings without the column marked as #0 The line saying trv = 'tree' can take the value as headings trv = 'headings' and the column with #0 will be hidden. My_w.mainloop()Watch the column with #0, this column will display in Tree and show the text part given in each row. from tkinter import ttkimport tkinter as tk# Creating tkinter my_wmy_w = tk.Tk()my_w.geometry("260x280") my_w.title("# Using treeview widgettrv = ttk.Treeview(my_w, selectmode ='browse')trv.grid(row=1,column=1,padx=30,pady=20) Tkitner Treeview to get Parent Child nodes and display data in hierarchical order
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |