Re: GtkTreeView: Setting colour of individual cells



On Wed, Mar 12, 2003 at 01:00:37AM +1100, Brett Nash wrote:

        However I can't see how to do this in the API, or any sample
code to do it.  Is there an example of this, or can someone show me the
sample code?

AFAIK, you can do this 2 ways: with a callback which you set with
gtk_tree_view_insert_column_with_data_func(), or by adding columns to your
model that acts as "control columns" (my terminology), e.g. suppose you have
4 data columns in your model; then add a 5th string type column to model
that will control the color of a cell (here a CellRendererText).  

gtk_tree_view_insert_column_with_attributes(treeview, -1, title, cell,
"text", TEXT_COLUMN, "background", COLOR_COLUMN)

Dave Cook



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