blob: b6d69437bb276a0d45bd839a8d9897649320178b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import urwid
class MultiPudding(urwid.Widget):
_sizing = frozenset(['flow', 'box'])
def rows(self, size, focus=False):
return 1
def render(self, size, focus=False):
if len(size) == 1:
(maxcol,) = size
maxrow = 1
else:
(maxcol, maxrow) = size
num_pudding = maxcol / len("Pudding")
return urwid.TextCanvas(["Pudding" * num_pudding] * maxrow,
maxcol=maxcol)
|