I'm trying to change the alternating background color of a treeview. I know that this should normally be left up to the theme, but I'd like to override to test the gtk Style functionality. According to the treeview documentation here, I learned that the TreeView has several style options that are Read-only, including "even-row-color", "odd-row-color" and "allow-rules"(which according to the documentation, allows drawing of even and odd row colors). And I know that in order to override those Read-only settings I've got to change the style in a gtkrc-style file or string.
So my string for a treeview looks like:
gtk.rc_parse_string( """
style "custom-treestyle"{
GtkTreeView::odd-row-color = "#00CBFF"
GtkTreeView::even-row-color = "#90EE90"
GtkTreeView::allow-rules = 1
}
widget "*custom_treeview*" style "custom-treestyle"
""")
treeview.set_name("custom_treeview" )
This parses without error and the result is that the even-row-color gets applied to both even and odd rows.
EDIT: I discovered from some more testing that my parse string must be getting overridden from some other style settings.
print treeview.style_get_property( 'allow-rules' )
print treeview.style_get_property( 'odd-row-color')
print treeview.style_get_property( 'even-row-color')
Gives the result:
True
None
None
Which are all default settings. Normally I would think that it's simply not parsing the string and setting the appropriate values, but in this case the background color does change to the color I specified( only it paints every row's background to one color).
What am I doing wrong?