[pygtk] How to change CellRendererToggle's background color

Mauricio Tellez mauricio.tellez at gmail.com
Tue Aug 15 22:16:31 WST 2006


Hi, I have a TreeView with 4 columns, the first and second has
CellRendererText and the thirth and fourth are CellRendererToggle. When the
user modify the value of any cell, I want to change the row's background
color. For the CellRendererText I use something like this:

myRender =3D gtk.CellRendererText()
myCol =3D gtk.TreeViewColumn('My title', myRender, text=3Dx, background=3Dy)

this work fine and my cell is colored, but when I tried this:

myRender =3D gtk.CellRendererToggle()
myCol =3D gtk.TreeViewColumn('My title', my Render, active=3Dv, activatable=
=3Dw,
background=3Dz)

pygtk complains that CellRendererToggle don't have a background property. So
my first 2 columns are colored but the last 2 don't. How can I fix this?
By the way, If I put only CellRendererText and change the background color,
The entire row's color isn't change, only the cell's color are change. I
mean, If I my row has 3 cell, I get 3 cell colored and this make the ilusion
of a colored row, but If you pay atention, there is a white line between
each cell. Is there a way to actually change's the entire row color to look
like the alternate color of gtk themes? Thanks for the help.

-- =

Mauricio Tellez
------------ pr=F3xima parte ------------
Se ha borrado un adjunto en formato HTML...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20060815/b9a834fa/at=
tachment.htm


More information about the pygtk mailing list