« Return to Thread: finding original cell background color in TreeView renderer

finding original cell background color in TreeView renderer

by Joaquim Schmidlap :: Rate this Message:

Reply to Author | View in Thread

I have a TreeView. Each column has a custom rendering callback  
function, which I use to change the color and formatting of the text  
in each cell as the data changes.

Under certain data conditions, I change the background color of the  
cell to be red, to get the user's attention. I do this with  
Gtk::CellRendererText::property_background_gdk() and it works great.

When the error condition clears, I need to set the color back to the  
default, since using properties like this seems to be "sticky." In  
other words, that cell will stay red until I change it. The problem I  
have now is that when I have set_rules_hint(true) for the TreeView, I  
need to figure out what color this cell should be based on the  
alternating row colors.

Is there a way to query the TreeView for what a given row's  
background color "should" be based on the hints? Clearly, it must be  
down in the implementation somewhere, but is this interface exposed  
to us?

I know I could query the background of some other cell in the row  
that didn't change, or maybe stuff the color in the model somewhere,  
but that feels a little funky to me. Seems like the TreeView must  
know if a given row is odd or even, and therefore what the color  
should be.


_______________________________________________
gtkmm-list mailing list
gtkmm-list@...
http://mail.gnome.org/mailman/listinfo/gtkmm-list

 « Return to Thread: finding original cell background color in TreeView renderer