1

I want to set it to red at the arrow "9" in the chart. Instead of the entire line what should I do? enter image description here

import tkinter as tk
from tkinter import ttk

root = tk.Tk()
tree = ttk.Treeview(root, show='headings')
buf = ['one', 'two', 'three', 'four', 'five']
tree["columns"] = buf
for i in buf:
    tree.column(i, width=len(i)*10)
    tree.heading(i, text=i)
for i in range(1, 5):
    tree.insert('', i-1, values=[i*y for y in range(1, 6)])

tree.item(tree.get_children()[2], tags=['tag_1'])
tree.tag_configure('tag_1', foreground='red')

tree.pack()
root.mainloop()
  • It looks you can't, probably because the tags apply to nodes, not node values. See [here](https://stackoverflow.com/questions/48358084/how-to-change-the-foreground-or-background-colour-of-a-selected-cell-in-tkinter) – progmatico Nov 27 '18 at 14:20
  • Thanks, I have to try other programs. – user10685205 Nov 28 '18 at 01:53
  • 1
    I found a clunky way to overwrite a canvas in a cell location。Meet my requirements by modifying the canvas background color – user10685205 Nov 28 '18 at 08:48

0 Answers0