def __init__(self, tp): Widget.__init__(self) self.tp = tp self._buf = AnnouncingTerminalBuffer(self.repaint) self._buf.width = self.width self._buf.height = self.height self._buf.connectionMade() self.tp.makeConnection(self._buf)
def draw(self, width, height, terminal): if width != self.width or height != self.height: self.resizeTerminal(width, height) Widget.draw(self, width, height, terminal)