GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Oct 21, 2014 6:23 pm

All times are UTC




Post new topic Reply to topic  [ 1 post ] 
Author Message
 Post subject: GtkTreeView modified rules hint - C
PostPosted: Wed Mar 12, 2008 2:18 am 
Offline

Joined: Tue Mar 11, 2008 8:58 pm
Posts: 4
I hope somebody finds helpful this function. I use it to set my own rules hint colors:

Code:
void
tree_data_func (GtkTreeViewColumn *col,
                    GtkCellRenderer   *renderer,
                    GtkTreeModel      *model,
                    GtkTreeIter       *iter,
                    gpointer           user_data)
{
   GtkTreePath *path = gtk_tree_model_get_path (model, iter);
   gint *ind = gtk_tree_path_get_indices (path);

   if((*ind % 2) != 0)
      g_object_set(renderer,"cell-background", "LightGreen", "cell-background-set", TRUE, NULL);
   else
      g_object_set(renderer, "cell-background-set", FALSE, NULL);
   return;
}/*tree_data_func*/


It's possible to enhance the function by receiving the color as a parameter.
I would appreciate if it is posted a better way to do this.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group