Re: GtkTreeView Row Style or Color



On Mon, 2005-08-29 at 16:52 +0300, Razvan Gavril wrote:
 Is there a way to modify the style(or only the color) of some rows(not all) 
in a GtkTreeView? I know it simple with GtkCList/GtkCTree(using 
gtk_clist_set_row_style) but i want to do something like that in a 
GtkTreeView. I know it must be a pain in the *** but maybe someone has an 
idea.


Hello.
Well... yes there is. If you look at the documentation you will see that
GtkTreeView rendering stuff is done by differents GtkCellRenderer
widgets.

One of the GtkCellRenderer property you could use is "cell-background".

Then to get and/or set a GObject property you have to use g_object_get()
and g_object_set() methods if there isn't any custom method for it.

So... when you are adding a column to a treeview simply do something
like this.

renderer = gtk_cell_renderer_text_new ();
g_object_set(renderer, "cell-background", "red", NULL);

Hope this helps

Juan Pablo

PD: you can find colors names in /etc/X11/rgb.txt


        

        
                
___________________________________________________________ 
1GB gratis, Antivirus y Antispam 
Correo Yahoo!, el mejor correo web del mundo 
http://correo.yahoo.com.ar 




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