Problem with row coloring



Hi all,

  I wanted to set the background color of rows in my list store. Here is the
chunk of code I'm working with, but it is not changing the color. Can anyone
help me out what is the problem

 

Regards

Laxmi

 

enum

{

  COL_DRPADDR,

  COL_BINVAL,

  COL_HEXVAL,

  COL_COLOR,

  NUM_DRPCOLS

};

store =
gtk_list_store_new(NUM_DRPCOLS,G_TYPE_STRING,G_TYPE_UINT,G_TYPE_STRING,
G_TYPE_STRING);

 

  drptableTreeWidget = gtk_tree_view_new_with_model(GTK_TREE_MODEL(store));

.

...

...

            column = gtk_tree_view_column_new();

 

            daddrRenderer = gtk_cell_renderer_text_new();

 

            gtk_tree_view_insert_column_with_attributes
(GTK_TREE_VIEW(drptableTreeWidget),

 
-1,

                    "DRP Addr",   

                            daddrRenderer,   

                        "text",0,

                        NULL);    

 
gtk_tree_view_column_add_attribute(column,daddrRenderer,"text",COL_DRPADDR);

 

            gtk_tree_view_column_add_attribute(column,
daddrRenderer,"background", COL_COLOR);

            

 

For(i=1;i<176;i++)

{

gtk_list_store_set(store, &iter,

                         COL_DRPADDR,addstr,

                         COL_BINVAL,DRPTable[i].value,

                         COL_HEXVAL,valstr,

                         COL_COLOR,"green",

                         -1);

 

   gtk_list_store_append(store, &iter); 

}

 

 




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