Vyacheslav Loginov
Vyacheslav Loginov

Reputation: 3216

gtk.TextBuffer color

I am using this example

http://www.pygtk.org/pygtk2tutorial/examples/testtext.py

but it doesn't work

i see only white textarea, terminal doesn't dispaly any notices

Ubuntu 11.04

Upvotes: 2

Views: 1823

Answers (1)

Riccardo Galli
Riccardo Galli

Reputation: 12925

You apply colors to textview, not textbuffer

tview = gtk.TextView()
# background
tview.modify_base(gtk.STATE_NORMAL, gtk.gdk.color_parse('#000000'))
# foreground
tview.modify_text(gtk.STATE_NORMAL, gtk.gdk.color_parse('#FFFFFF'))
# bonus font
tview.modify_font(pango.FontDescription('Monospace 11'))

Upvotes: 7

Related Questions