diff options
author | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-01-27 21:44:48 +0000 |
---|---|---|
committer | louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13> | 2010-01-27 21:44:48 +0000 |
commit | 5137f86445221f802a78bcc393f5c63f3625422f (patch) | |
tree | 8c015922b4d9914cf817f91cea069bd90de19049 /src/window.py | |
parent | 9275ded3338b6f1fa356aaa4ee306dcb1e20b019 (diff) | |
download | poezio-5137f86445221f802a78bcc393f5c63f3625422f.tar.gz poezio-5137f86445221f802a78bcc393f5c63f3625422f.tar.bz2 poezio-5137f86445221f802a78bcc393f5c63f3625422f.tar.xz poezio-5137f86445221f802a78bcc393f5c63f3625422f.zip |
quelques fixs, genre l'historique et les accents et tout ca
Diffstat (limited to 'src/window.py')
-rw-r--r-- | src/window.py | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/window.py b/src/window.py index 97c1f6d0..be9416fd 100644 --- a/src/window.py +++ b/src/window.py @@ -142,9 +142,11 @@ class TextWin(object): break win.addstr('\n['+line[0].strftime("%H:%M:%S") + "] <") length = len('['+line[0].strftime("%H:%M:%S") + "] <") - win.attron(curses.color_pair(user.color)) + try:win.attron(curses.color_pair(user.color)) + except:pass win.addstr(line[1]) - win.attroff(curses.color_pair(user.color)) + try:win.attroff(curses.color_pair(user.color)) + except:pass win.addstr("> ") win.addstr(line[2]) @@ -175,11 +177,19 @@ class Input(Win): self.input.insert_mode = True self.win.clear() + def key_dc(self): + """delete char""" + if self.pos == len(self.text): + return + (y, x) = self.win.getyx() + self.text = self.text[:self.pos]+self.text[self.pos+1:] + self.win.delch(y, x-1) + def key_up(self): self.win.clear() if self.histo_pos >= 0: self.histo_pos -= 1 - self.win.addstr(self.history[self.histo_pos+1]) + self.win.addstr(self.history[self.histo_pos+1].encode('utf-8')) self.text = self.history[self.histo_pos+1] self.pos = len(self.text) self.refresh() @@ -188,7 +198,7 @@ class Input(Win): self.win.clear() if self.histo_pos < len(self.history)-1: self.histo_pos += 1 - self.win.addstr(self.history[self.histo_pos]) + self.win.addstr(self.history[self.histo_pos].encode('utf-8')) self.text = self.history[self.histo_pos] self.pos = len(self.text) else: @@ -242,7 +252,7 @@ class Input(Win): self.pos = 0 self.history.append(txt) self.histo_pos = len(self.history)-1 - return txt + return txt.encode('utf-8') def save_text(self): self.txt = self.input.gather() |