Re: How can i change background color of first column data

2017-03-24 Thread Tilo Villwock

> But i don't know how to change first column background just in the
> data.

There are two ways. If you need to have individual colors for each row
you would define a column that you use to store your background color
in for every entry of your GtkListStore. Let's say you define a column
as COLUMN_BACKGROUND like this:

enum {
...
COLUMN_BACKGROUND,
...
N_COLUMNS
};

Then you could do the following:

gtk_list_store_append(store, );
gtk_list_store_set(store, ,
...
COLUMN_BACKGROUND, "#ff00ff",
-1);

GtkTreeViewColumn *first_column;
first_column = gtk_tree_view_column_new_with_attributes(
"First Column", first_column_renderer,
...
"cell-background", COLUMN_BACKGROUND,
NULL);

The other ways is to set it directly on the cell renderer:

GtkCellRenderer* first_renderer;
first_renderer = gtk_cell_renderer_text_new();
g_object_set(first_renderer,
...
"cell-background", "#ff00ff",
NULL);

Hope that helps.

Cheers,

--Tilo
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How can i change background color of first column data

2017-03-24 Thread RĂºben Rodrigues
Hi guys,

I have a problem with treeview. My first column of treeview where we 
have data, is yellow. I want to change to other color. How i make this 
in css? I changed the background color of column header with this code:

column-header .button{
 background-color: #5b5b5b;
 color: black;
}

But i don't know how to change first column background just in the data.

THanks


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list