Gtk2: GtkCellRendererText: changing bgcolor based on..


It's a GTK-2.0 question, so I'm not sure if I have to use this
mailinglist.. :)

Anyway. I have a GtkTreeView with a GtkListStore and such. It updates
every 300ms (query to database, get rows, show rows). It's a monitoring
system. It's running really great, and I'm not sure if I can make it
faster with other widgets.

To make it more appealing, the cells should have colors. Like a time
cell > 5 secs.. color red and so on.

Now, I can set the cell color with g_object_set().. But I want to do
this when updating the Store.. So on the fly a color where a column can
have let's say 5 different colors.. you know.
I tried to set the property in the iteration making the list, but I'm
not successful. Probably it is not placed correctly.

So, do I need to write a new GtkCellRenderer that can based on the value
the cell has, change it's backgroundcolor. Or can I do it with
You know, a signal like 'changed' instead of 'edited' would be great :)



Geert Vanderkelen
Ypsilon.Net AG

Geert Vanderkelen

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]