tags:

views:

418

answers:

2

I want to make the background of a textview widget black and the foreground white.

Been trying the .modify_bg and .modify_fg methods, but none affect the way this thing looks.

Can anyone suggest anything or is this just not possible?

+1  A: 

I resolved some similar manipulating the gtk rcstyles:

widget.set_name('mywidget')

# Set mywidget internal style.
gtk.rc_parse_string('\
    style "mywidget"\n\
    {\n\
        attribute1 = value1\n\
        attribute2 = value2\n\
    }\n\
    widget "*.mywidget" style "mywidget"')

See gtk.rcstyle at:

bg[state] = color (Sets the color used for the background of most widgets.)

mkotechno
How about an equivalent of this in python... anyone?
M0E-lnx
You can save that in a file (also, you can edit it later of write an editor for it). Reload the stuff using gtk.rc_parse(file_path)
markuz
+1  A: 

Use gtk.Widget.modify_text and gtk.Widget.modify_base instead of fg and bg.

ptomato
The gtk.widget.modify_base does indeed change the background of the widget, but I cant' find a way to change the color of the text now... so the text is invisible
M0E-lnx
`modify_text()`
ptomato