I was looking for the same thing that Tim was looking for in this thread - http://lists.ximian.com/pipermail/gtk-sharp-list/2008-April/008605.html - and the solutions provided within the thread seemed more complicated than necessary. I have found the solution using theme settings: Steps: 1. the Gtk.TreeView.RulesHint property must be set to TRUE (the default is FALSE). See http://library.gnome.org/devel/gtk/stable/GtkTreeView.html#GtkTreeView-- rules-hint for documentation 2. Since the colors can not be set in the application itself (atleast I found no way to do that in Gtk#) you will need to specify them in a gtkrc file. If you have your own theme that is loaded by your application you can specify the colors there (see gtkrc documentation on how to select themes for your application). 3. In the gtkrc file you will now need three setting to activate alternating row colors style "treeview" { GtkTreeView::allow-rules = TRUE GtkTreeView::even-row-color = "red" GtkTreeView::odd-row-color = "blue" } class "GtkTreeView" style "treeview"
It turned out that both the TreeView and the theme need to have the rules property set to TRUE for this to work! Philip
_______________________________________________ Gtk-sharp-list maillist - [email protected] http://lists.ximian.com/mailman/listinfo/gtk-sharp-list
