New submission from Acid Ascorbic <ascorbic.acid.te...@gmail.com>:
It is impossible to set colors properly in Treeview. Python behavior is different between versions 3.6.2 and 3.7.3/3.8.0. Origin: https://stackoverflow.com/questions/57634982/can-i-change-the-foreground-color-of-a-single-column-in-python-treeview/59047842 Example 1: from tkinter import ttk import tkinter as tk root = tk.Tk() tree = ttk.Treeview(root) c = tree.insert('', 'end', text='This is critical message', tags='critical') tree.insert(c, 'end', text='This is child of critical message', tags='critical') for i in range(5): tree.insert('', 'end', text='This is non-critical message') tree.tag_configure('critical', background='red', foreground="black") tree.pack() root.mainloop() Example 2: import tkinter as tk from tkinter import ttk root = tk.Tk() style = ttk.Style(root) style.theme_use("clam") style.configure("Treeview", background="black", fieldbackground="black", foreground="white") tree = ttk.Treeview(root) tree.insert("", 0, "item", text="item") tree.pack() root.mainloop() ---------- components: Tkinter messages: 357501 nosy: Acid Ascorbic priority: normal severity: normal status: open title: Color setting doesn't work in tkinter type: behavior versions: Python 3.7, Python 3.8 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue38917> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com