M0E-lnx
M0E-lnx

Reputation: 725

pygtk: howto change background of a gtk.TextView widget

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?

Upvotes: 0

Views: 1685

Answers (2)

ptomato
ptomato

Reputation: 57854

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

Upvotes: 2

Htechno
Htechno

Reputation: 6117

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.)

Upvotes: 2

Related Questions