summaryrefslogtreecommitdiff
path: root/src/window.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-10 09:05:47 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-10 09:05:47 +0000
commite3974e8524283e8cc3d4c4df6a51648b8117f5b6 (patch)
treec6d5216544b824da7268d25a5cee7ce47c6f5c11 /src/window.py
parentfa4fbeb23cc243209280b1da5240fc46b9afcfbb (diff)
downloadpoezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.gz
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.bz2
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.xz
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.zip
The room info bar and highlights work again.
Diffstat (limited to 'src/window.py')
-rw-r--r--src/window.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/window.py b/src/window.py
index ab5c8492..bc41f74d 100644
--- a/src/window.py
+++ b/src/window.py
@@ -196,7 +196,7 @@ class TextWin(Win):
else:
x = 11
self.win.attron(curses.color_pair(8))
- y += self.write_text(y, x, message.txt)
+ y += self.write_text(y, x, message.txt, message.color)
if message.nickname is None:
self.win.attroff(curses.color_pair(8))
# self.win.addnstr(y, x, message.txt, 40)
@@ -204,12 +204,14 @@ class TextWin(Win):
y += 1
self.win.refresh()
- def write_text(self, y, x, txt):
+ def write_text(self, y, x, txt, color):
"""
return the number of line written, -1
"""
txt = txt.encode('utf-8')
l = 0
+ if color:
+ self.win.attron(curses.color_pair(color))
while txt != '':
debug(txt)
if txt[:self.width-x].find('\n') != -1:
@@ -220,6 +222,8 @@ class TextWin(Win):
self.win.addnstr(y+l, x, txt, limit)
txt = txt[limit+1:]
l += 1
+ if color:
+ self.win.attroff(curses.color_pair(color))
return l-1
def write_nickname(self, y, nickname, user):