You are not logged in.

#1 2013-10-22 13:17:56

GERUM
Member
Registered: 2013-10-18
Posts: 18

[SOLVED] PyGTK TreeView row background color

I found a few examples, but all of them show how to change the background color while creating the TreeView, but I need to change it dynamically.

For example, lets imagine I have a TreeView:

ID              Name              Score
------------------------------------------
1               John              10
2               Michael           5
3               George            90

How do I change row X background to red as soon as the user enters (let it be a simple text box) ID he wants to see highlighted?

Last edited by GERUM (2013-10-22 17:32:59)

Offline

#2 2013-10-22 14:49:19

HenrikJuul
Member
From: Aalborg, Denmark
Registered: 2013-10-22
Posts: 4

Re: [SOLVED] PyGTK TreeView row background color

As far as I understand the documentation of TreeView and its related objects, the background can only be changed on CellRenderers: Meaning that if you instantiate a CellRenderer for each cell (they dont seem to span rows, only columns) you could change backgrounds with:

CellRenderer.set_property('cell-background','color')

Another possibility would be to use "Pango markup" and change cell values, but I don't believe that the output is as neat.

http://www.pygtk.org/pygtk2tutorial/sec … erers.html has some information on the subject.

Last edited by HenrikJuul (2013-10-22 14:49:31)

Offline

#3 2013-10-22 17:32:42

GERUM
Member
Registered: 2013-10-18
Posts: 18

Re: [SOLVED] PyGTK TreeView row background color

Offline

Board footer

Powered by FluxBB