25 lines
613 B
Python
25 lines
613 B
Python
|
|
from .widimp import WidImp
|
|
|
|
class Info(WidImp):
|
|
|
|
def __init__(self):
|
|
self.changed = False
|
|
self.lines = []
|
|
self.lastString = None
|
|
|
|
def showString(self, string):
|
|
if string == self.lastString:
|
|
return
|
|
self.lines = string.split('\n')
|
|
self.change()
|
|
self.lastString = string
|
|
|
|
def update(self, win):
|
|
width, height = win.getSize()
|
|
lines = [line[:width-1] for line in self.lines][:height]
|
|
win.erase()
|
|
for i, line in enumerate(lines):
|
|
win.addLine((0, i), line)
|
|
win.noutrefresh()
|