Hi,

Am Montag, den 12.12.2005, 07:53 -0500 schrieb Gary Jaffe:
> Hi --
> 
> I have a GtkTreeView that is working fine, but I would like to change 2 
> things.
> 
> 1) Change the background color in the text area and

I sure hope you have a good reason for that, like changing it to RED to
GREEN as a status info (even then, not sure if it's ok to hardcode
that).

that said, you can set background modify_bg / modify_base or on the cell
renderer by referring to a cell in the tree store for the background
info.

> 
> 2) Reduce the amount of vertical space between the text lines.

Don't. Modify the theme. Edit ~/.gtkrc-2.0
(or load an external theme file for the app from the user's homedir -
somewhere he can modify things)

> 
> To change the background color, I tried
> 
> viewBgCol = gtk.gdk.color_parse("#808080")
> view.modify_bg(gtk.STATE_NORMAL, viewBgCol)

The background color of the even rows or the odd rows or where there are
no rows or the selected row or the marked row or the selected and marked
row?

> 
> but this did not change the color.  For the reduction of space, I've 
> read through the pango docs, but was not able to figure out how to do 
> this.  Any help would be appreciated.

Edit  ~/.gtkrc-2.0 

I'd say it is a style property of the GtkTreeView or whatever Cell
Renderer you use.

The basic rule of thumb is: Honor the theme the user has chosen and
match those settings as close as possible.

As I said, there are exception, like for highlighting problematic rows
or such, but usually honor the rule.

> 
> I'm running gtk version 2.8.6 and pygtk version 2.8.1.
> 
> Thanks,
> Gary

cheers,
   Danny


_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to