changeset 6 | d4ee152d7d07 |
child 7 | d4a291b31cbb |
5:ae128c885d0f | 6:d4ee152d7d07 |
---|---|
1 # -*- coding: utf-8 -*- |
|
2 |
|
3 from .widget import Widget |
|
4 |
|
5 |
|
6 class Label(Widget): |
|
7 def __init__(self, label=''): |
|
8 Widget.__init__(self, len(label), 1) |
|
9 |
|
10 self.label = label |
|
11 self.connect('draw', self.on_draw) |
|
12 |
|
13 |
|
14 def on_draw(self, screen, x, y): |
|
15 screen.puts(x, y, self.label) |
|
16 |
|
17 |