On Tue, 2003-01-14 at 09:44, James Henstridge wrote: > Omar Kilani wrote: > > >Hello, > > > >I was wondering if someone could advise on a way of doing conditional > >colouring of cells. Say I have: > > > >-----|------| > > one | four | > >-----|------| > > two | five | > >-----|------| > >three| six | > > > >And I wanted to give each cell a different colour (based on its contents > >or cell data.) How would I do it? > > > >CellRendererText seems to apply the background/foreground colours to the > >whole column. > > > >Do I need to implement my own cell renderer? > > > >I may be able to do it with treeview.get_cell_area, but I'm not sure how > >to pass in the GdkRectangle argument. > > > > > Simply create a column in your model of type string which contains the > colour you want for the cell. Then when setting up the tree view > column, map that column to the "cell_foreground" or "cell_background" > properties of the cell renderer. > Hi,
I wondered about the same thing some weeks ago. Sorry for being silly, but I don't understand how that method is going to give you different colors in individual cells and not just alter the colors in different columns. Best regards Řistein _______________________________________________ pygtk mailing list [EMAIL PROTECTED] http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/