6/24/2023 0 Comments Tkinter treeview exampleTree.insert("",index=END,text="Coca-Cola",image=imgObj3,values=info) Img3 = Image.open("apidemos.png") # Insert apidemos.png Tree.insert("",index=END,text="Swiss Railways",image=imgObj2,values=info) Img2 = Image.open("apidemos.png") # Insert apidemos.png ![]() Tree.insert("",index=END,text="Phoenix News",image=imgObj1,values=info) Img1 = Image.open("apidemos.png") # Insert apidemos.png lumn("#1",width=300) # Formatting column headings Tree.heading("#1",text="Function Description") Tree = Treeview(root,columns=("Description")) "Coca-Cola App is a software for entertainment"] "Swiss National Rail App provides all Swiss train schedules", Info = ["The Phoenix News App provides access to the latest news from around China", Style().configure("Treeview",rowheight=35) # Formatted expansion row height Style().configure("TreeView", rowHeight=xx) # xx is the height setting Example#1ĭesign a Treeview with images. This can be handled with the following Style( ) method. ![]() ![]() What you need to consider when adding an image is that the height of the row may be insufficient, so you must increase the height. If you add the image parameter within the insert( ) method you can add an image.
0 Comments
Leave a Reply. |