[pygtk] How to change CellRendererToggle's background color

John Finlay finlay at moeraki.com
Wed Aug 16 06:32:23 WST 2006


Mauricio Tellez wrote:
> 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 = gtk.CellRendererText()
> myCol = gtk.TreeViewColumn('My title', myRender, text=x, background=y)
>
> this work fine and my cell is colored, but when I tried this:
>
> myRender = gtk.CellRendererToggle ()
> myCol = gtk.TreeViewColumn('My title', my Render, active=v, 
> activatable=w, background=z)
>
> 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?
Try using the "cell-background" property

John


More information about the pygtk mailing list