- PyGTK programs can also respond to external non-GUI events
The Twisted Protocol Factory calls the
writeMessage
method on our Chatter class:def lineReceived(self, line): self.chatter.writeMessage(line)
In turn:
def writeMessage(self, msg): self.buffer.insert_at_cursor('%s\n' % msg)