Re: [gtkmm] color rows in treeview



>>I have small problem. I need Gtk::TreeView with rows (some special rows)
>>with another color then gtk style, for example red (font or background).
>>
> In CellRendererText documentation you may find list of attributes that
> could be used for your needs. Of course, your row should contain only
> text columns then.

I don't think that's true. cell_background is in the base class, so it
should work for all CellRenderers:
http://www.gtkmm.org/docs/gtkmm-2.4/docs/reference/html/classGtk_1_1CellRenderer.html#a33

> One of solutions may be following:
> - create hidden column in your model to hold row color
> - when adding columns to TreeView, link column renderer color attribute
> with hidden column ( TreeView::Column::add_attribute() ), so, changing
> value for hidden column in model would change row color or whatever you
> need (depending on attribute you've linked)

Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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