I have a processwindow which include a textview. The Textview has a textbuffer. With the following code i can print some text in this textbuffer-->textview--processwindow.
I want to change the color of the TextBuffer. How i can do this ?
import pygtk
import gtk
import gtk.glade
def __init__(self):
self.gladefile = "XXXXX.glade"
self.builder = gtk.Builder()
self.builder.add_from_file(self.gladefile)
self.builder.connect_signals(self)
self.window = self.builder.get_object("window1")
self.textbuffer = self.builder.get_object("textbuffer1")
def Print(self, text):
self.textfeld = self.textfeld + '\n' + text
self.textbuffer.set_text(self.textfeld)
I found the solution myself. For my Solution you need "import Pango".
Note: .set_text() is not the same like .inser_with_tags, therefore i changed the self.textfeld command.