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

Time:03-16

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?

CodePudding user response:

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
  • Related