blob: 599627cef243c87d3b5e6f9e9b067778203d690a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
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()
|