You can define the background and foreground for your tree cells in the additional fields of the treeview data source. Then configure the foreground and background attributes for the columns of the tree to get their values ββfrom the corresponding fields in the data source.
Below is a small example:
import gtk test_data = [ { 'column0' : 'test00', 'column1' : 'test01', 'f': '#000000', 'b': '#FF00FF' }, { 'column0' : 'test10', 'column1' : 'test11', 'f': '#FF0000', 'b': '#C9C9C9' }, { 'column0' : 'test20', 'column1' : 'test21', 'f': '#00FF00', 'b': '#FF0000' }] class TestWindow(gtk.Window): def __init__(self): gtk.Window.__init__(self)
hope this helps, believes
source share