I want to apply different background for tags in Treeview but when I set tag for example as "minus" and try to configure tag to have black background it stills returns white background.
I've tried applying Style and set background to desired RGB to Treeview but background remains white. I've also tried to set tags and configure tag background to desired RGB but it is still returned as white!
for row in rows:
self.treeplan.insert('', 'end', text=str(cpt),
values=(row[1], row[2], row[3], row[4],
row[5], row[6], row[7], row[8],
row[9], row[10], row[11], row[12],
row[13], row[14], row[15]),
tags='minus')
cpt += 1
self.treeplan.tag_configure('minus', background="#%02x%02x%02x" % (61, 72, 73),
foreground="red")
And here is Style:
self.style = ttk.Style(master)
self.style.theme_use("clam")
self.style.configure("mystyle.Treeview", bd=0, background="black",
foreground="white", fieldbackground="red")
self.style.configure("mystyle.Treeview.Heading", font=('Calibri', 9,
'bold'), background="#383838", foreground="white")
self.style.layout("mystyle.Treeview", [('mystyle.Treeview.treearea',
{'sticky': 'news'})])
I actually want to set background of all Treeview items to "#%02x%02x%02x" % (61, 72, 73)
**EDIT:
I'm adding part of code with Treeview:
self.treeplan_frame = Frame(master, background=rgbcon2((39, 46, 46)))
self.treeplan_frame.grid(row=7, column=0, columnspan=8, sticky="nws", pady=10, padx=10)
self.treeplan = ttk.Treeview(self.treeplan_frame, height=19, style="mystyle.Treeview")
As you see, I tried to change background with Style with no luck. Then I've tried to change by configuring tags (tag/tags). I've checked different threads and I'm not quite clear why in this case it doesn't work. Btw. I it is Python 3.7 and Tkinter 8.6. When I had 3.6 I hadn't any problems and previous version of Tkinter (I'm not sure which one).