[pygtk] problems with styles

David N. Welton davidw@linuxcare.com
10 Jul 2000 18:17:03 +0200


[ cc replies to me - thanks ]

So, I am having some difficulties with styles.

What I want to do: change the color of a CList row.

But I'm running into some troubles...  By way of example:

>>> from gtk import *
>>> win = GtkWindow()
>>> win.style
>>> style = win.get_style().copy()
>>> dir(style)
['base', 'base_gc', 'bg', 'bg_gc', 'bg_pixmap', 'black', 'black_gc', 'colormap', 'copy', 'dark', 'dark_gc', 'fg', 'fg_gc', 'font', 'light', 'light_gc', 'mid', 'mid_gc', 'text', 'text_gc', 'white', 'white_gc']
>>> style.text
<GtkStyleHelper object at 8092368>
>>> style.text = style.black
Traceback (innermost last):
  File "<stdin>", line 1, in ?
AttributeError: text

I don't get it...  

What is the problem I'm encountering here?  But of more importance -
how do I go about changing the color of the CList row (the
background).

Thanks,
-- 
David N. Welton, Responsabile Progetti Open Source, Linuxcare Italia spa
tel +39.049.8043411 fax +39.049.8043412 cel +39.348.2879508
davidw@linuxcare.com, http://www.linuxcare.com/
Linuxcare. Support for the revolution.