diff options
-rw-r--r-- | src/gui.py | 12 | ||||
-rw-r--r-- | src/window.py | 10 |
2 files changed, 12 insertions, 10 deletions
@@ -159,10 +159,11 @@ class Gui(object): if room_from == room.name: room.add_message(nick_from, stanza.getBody()) if room == self.rooms[0]: - # self.window.text_win.refresh(room.lines) - # self.window.user_win.refresh(room.users) - # self.window.input.refresh() - self.window.refresh(self.rooms[0]) + self.window.text_win.refresh(room.lines) + self.window.user_win.refresh(room.users) + self.window.input.refresh() +# self.window.refresh(self.rooms[0]) + curses.doupdate() break def room_presence(self, stanza): @@ -174,6 +175,7 @@ class Gui(object): if room == self.rooms[0]: self.window.text_win.refresh(room.lines) self.window.user_win.refresh(room.users) + curses.doupdate() break def execute(self): @@ -201,7 +203,7 @@ class Gui(object): def main_loop(self, stdscr): while 1: - stdscr.refresh() + curses.doupdate() # self.window.input.refresh() key = stdscr.getch() if key == curses.KEY_RESIZE: diff --git a/src/window.py b/src/window.py index 1cff8acf..89003456 100644 --- a/src/window.py +++ b/src/window.py @@ -52,7 +52,7 @@ class UserList(Win): self.win.addstr(y, 1, user.nick) self.win.attroff(curses.color_pair(color)) y += 1 - self.win.refresh() + self.win.noutrefresh() def resize(self, height, width, y, x, stdscr): self._resize(height, width, y, x, stdscr) @@ -68,8 +68,8 @@ class Info(Win): self.win.clear() self.win.addstr(0, 0, room_name + " "*(self.width-len(room_name)-1) , curses.color_pair(1)) -# self.win.addstr(0, 0, "fion") - self.win.refresh() + self.win.noutrefresh() + class TextWin(Win): def __init__(self, height, width, y, x, parent_win): @@ -86,7 +86,7 @@ class TextWin(Win): elif len(line) == 3: self.win.addstr(y, 0, '['+line[0].strftime("%H:%M:%S") + "] " + line[1]+": "+line[2]) y += 1 - self.win.refresh() + self.win.noutrefresh() def resize(self, height, width, y, x, stdscr): self._resize(height, width, y, x, stdscr) @@ -115,7 +115,7 @@ class Input(Win): self.txt = self.input.gather() def refresh(self): - self.win.refresh() + self.win.noutrefresh() def clear_text(self): self.win.clear() |