diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-11-09 01:23:35 +0100 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-11-09 01:23:35 +0100 |
commit | ad0b3b41ecc0003f3d5b4fdb9799b6e325127e1f (patch) | |
tree | 3f2bbf1be7f753f1c7495f0a60833f469e7f10a7 /src/data_forms.py | |
parent | 7fadb35fe2e7932a0a4aa6a8184ab6b186669edc (diff) | |
parent | 03999f1ef08036b7ea25e2239cf7b6bcdb4d76cc (diff) | |
download | poezio-ad0b3b41ecc0003f3d5b4fdb9799b6e325127e1f.tar.gz poezio-ad0b3b41ecc0003f3d5b4fdb9799b6e325127e1f.tar.bz2 poezio-ad0b3b41ecc0003f3d5b4fdb9799b6e325127e1f.tar.xz poezio-ad0b3b41ecc0003f3d5b4fdb9799b6e325127e1f.zip |
Merge branch 'plugins'
Conflicts:
README
src/core.py
src/tabs.py
Diffstat (limited to 'src/data_forms.py')
-rw-r--r-- | src/data_forms.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/data_forms.py b/src/data_forms.py index a7bbe97f..8445d3d2 100644 --- a/src/data_forms.py +++ b/src/data_forms.py @@ -152,6 +152,26 @@ class DummyInput(FieldInput, windows.Win): def is_dummy(self): return True +class ColoredLabel(windows.Win): + def __init__(self, text): + self.text = text + self.color = 14 + windows.Win.__init__(self) + + def resize(self, height, width, y, x): + self._resize(height, width, y, x) + + def set_color(self, color): + self.color = color + self.refresh() + + def refresh(self): + with g_lock: + self._win.attron(curses.color_pair(self.color)) + self.addstr(0, 0, self.text) + self._win.attroff(curses.color_pair(self.color)) + self._refresh() + class BooleanWin(FieldInput, windows.Win): def __init__(self, field): FieldInput.__init__(self, field) @@ -502,6 +522,7 @@ class FormWin(object): for i, inp in enumerate(self.inputs): if i >= self.height: break + inp['label'].refresh() inp['input'].refresh() inp['label'].refresh() if self.current_input < self.height-1: |