简体   繁体   中英

How can I change the color of certain columns/boxes in a tkinter Treeview?

I'm wondering how I can change the color of a tkinter treeview box. My goal is to try to make it so if the number in the column is above 0, it'd be green, while if it's below 0, it'd be red. Does anyone know how I can make that happen?

See this page for an overview of all widgets and their style options. From the bottom of it you can choose one of the following options:

Treeview (widget):
    background
    foreground
    fieldbackground

Heading:
    background
    foreground

Item:
    background
    foreground

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM