tuikit/widgets/label.py
author Radek Brich <radek.brich@devl.cz>
Wed, 19 Mar 2014 00:32:38 +0100
changeset 89 94f5baef19ac
parent 87 ee5ea9671f28
child 94 e50dae408fe9
permissions -rw-r--r--
Add Theme, Button.

from tuikit.core.widget import Widget


class Label(Widget):

    def __init__(self, label=''):
        Widget.__init__(self)
        self.sizereq.update(len(label), 1)
        self.label = label
        self.color = 'default'

    def set_theme(self, theme):
        self.color = self.theme.normal

    def draw(self, buffer, x, y):
        with buffer.attr(self.color):
            buffer.puts(x, y, self.label)