Re: TreeView and setting row colors



On Fri, 21 Jun 2002 15:42:23 +0200
"Olaf Fr" <olaf cbk poznan pl> wrote:

I need to set particular color for rows in GtkTreeView.
I would like to change the background color, or text color.
AFAIR there was some similar question on this list. but I haven't found
any resolution.

the textrenderer has a lot of style options, add them like this:

renderer = gtk_cell_renderer_text_new();
g_object_set(G_OBJECT(renderer), "xpad", 0, NULL);
g_object_set(G_OBJECT(renderer), "ypad", 0, NULL);
column = gtk_tree_view_column_new_with_attributes("",renderer,"text", FILENAME_COLUMN,NULL);
gtk_tree_view_column_set_spacing(column, 0);
gtk_tree_view_append_column(GTK_TREE_VIEW(filebrowser.tree), column);

regards,
        Olivier

Attachment: pgpY5KQC7h3YG.pgp
Description: PGP signature



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