summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/windows.py b/src/windows.py
index 315ef84d..682d6487 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -154,14 +154,19 @@ class UserList(Win):
class Topic(Win):
def __init__(self):
Win.__init__(self)
+ self._message = ''
def resize(self, height, width, y, x, stdscr):
self._resize(height, width, y, x, stdscr)
- def refresh(self, topic):
+ def refresh(self, topic=None):
with g_lock:
self._win.erase()
- self.addstr(0, 0, topic[:self.width-1], curses.color_pair(theme.COLOR_TOPIC_BAR))
+ if topic:
+ msg = topic[:self.width-1]
+ else:
+ msg = self._message[:self.width-1]
+ self.addstr(0, 0, msg, curses.color_pair(theme.COLOR_TOPIC_BAR))
(y, x) = self._win.getyx()
remaining_size = self.width - x
if remaining_size:
@@ -169,6 +174,9 @@ class Topic(Win):
curses.color_pair(theme.COLOR_INFORMATION_BAR))
self._refresh()
+ def set_message(self, message):
+ self._message = message
+
class GlobalInfoBar(Win):
def __init__(self):
Win.__init__(self)
@@ -1362,12 +1370,13 @@ class ListWin(Win):
return
self.lines += lines
self.refresh()
+ curses.doupdate()
def get_selected_row(self):
"""
Return the tuple representing the selected row
"""
- if self._selected_row is not None:
+ if self._selected_row is not None and self.lines:
return self.lines[self._selected_row]
return None