The first treeview which had a particular style was:
class tree:
def __init__(self):
self.tree = ttk.Treeview(frametree,height=28)
self.tree.grid(row=1,column=0,padx=2)
self.tree.column("#0",width=250, stretch=NO)
self.tree.bind("<ButtonRelease-1>", self.OnClick)
self.tree.tag_configure('highlight', background='lightblue')
style_def = ttk.Style(frametree)
style_def.configure("Treeview", background="#FFDEAD",fieldbackground="#FFDEAD", foreground="Black", font=(None, 14), sheight=14, rowheight=30)
style_def.configure("Treeview.Heading",font=(None, 12))
The following code was used for showing the treeview:
# for displaying treeview
#tree000 = tree()
if __name__ == "__main__":
tree000 = tree()
The another table was styled in different way as follows:
style_wear = ttk.Style(firsttreeframe)
style_wear.configure("Treeview.Heading", font=(None, 13))
style_wear.configure("Treeview", font=(None, 12))
tree02 = ttk.Treeview(firsttreeframe, column=("c1", "c2","c3", "c4","c5", "c6","c7", "c8","c9","c10", "c11","c12", "c13","c14", "c15","c16", "c17","c18"), show='headings', height=5)
And finally used grid method to place the treeview table.
tree02['show']='headings'
tree02.grid(row=1,column=0,columnspan=4,sticky=EW)
But tree1
gets the style of first tree. I don't know why maybe because of treeview display method.
I tried running placing the treeview in separate project It works fine as you can see:
In app
first tree:
Second tree:
You can see both has same style
In separate project:
I want my app to show this style to the second tree but it gets the style of the first tree.
Please help me with this.