[pygtk] cell.set_property and colors

Alessandro Dentella sandro at e-den.it
Thu Sep 25 23:48:54 WST 2008


Hi,

   I want to color single cells in a TreeView (totals of a table).
   Since I'm using cell_data_func to set value of property text I tried
   using that same function to set colors but it turns out all cells get
   colored... 

    def dict_cell_data_func(self, column, cell, model, iter, (col_num, name)):
        obj = model.get_value(iter, col_num) 
        value = getattr(obj, name)
        cell.set_property("text", value)
        if value == 'venice':
            cell.set_property("cell-background", 'yellow')
   

   can anybody help me understanding why?

   I attach the complete example.

   thanks in advance
   sandro
   *:-)
-------------- parte successiva --------------
Un allegato non testuale è stato rimosso....
Nome:        tre_dict.py
Tipo:        text/x-python
Dimensione:  1090 bytes
Descrizione: non disponibile
Url:         http://www.daa.com.au/pipermail/pygtk/attachments/20080925/633f9961/attachment.py 


More information about the pygtk mailing list