[Gtk-sharp-list] different color rows for GtkTreeView

Peter Johanson peter at peterjohanson.com
Mon Apr 28 17:02:05 EDT 2008

On Mon, Apr 28, 2008 at 04:47:49PM -0400, Tim Howard wrote:
>    So I guess there's no easy way to do this? So far it sounds _A LOT_
>    harder than it needs to be. Ultimately I want to model something of a
>    checkbook register where every other row is light green.
>    If anyone else has any insight into this, I would greatly appreciate
>    it.

The way I would do this manually would be for a given Gtk.TreePath that
you're rendering, check path.Indices[0] % 2, and see if the value is 0
or 1, to determine even/odd row, then set the background color of the
row appropriately in your TreeCellDataFunc callback.


More information about the Gtk-sharp-list mailing list