From da12ee01d2776bc35a22718967c2ddc2c3d7c6aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20Cort=C3=A9z?= Date: Mon, 19 Dec 2016 09:55:30 -0600 Subject: [PATCH] Fixed a bug that causes characers invisible in readline implementation --- guicurses/widgets.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/guicurses/widgets.py b/guicurses/widgets.py index 01966c4..3e8aeb7 100644 --- a/guicurses/widgets.py +++ b/guicurses/widgets.py @@ -85,7 +85,7 @@ class Button(GuiObject): def draw(self): s = self.prompt - self.screen.addstr(self.y, self.x, s.encode("utf-8")) + self.screen.addstr(self.y, self.x, s) self.screen.refresh() def handleKey(self, k): @@ -354,7 +354,7 @@ length: the maximum length for this text entry delimiter: the delimiter between prompt and text readonly: whether to accept new text """ - def __init__(self, screen=None, base=None, y=0, x=0, history=[], prompt=u"input", default=u"", echo=True, maxLength=0, delimiter=u": ", readonly=0, action=""): + def __init__(self, screen=None, base=None, y=0, x=0, history=[], prompt=u"input", default=u"", echo=False, maxLength=0, delimiter=u": ", readonly=0, action=""): self.value = default self.done = 0 self.base = base @@ -493,7 +493,7 @@ readonly: whether to accept new text if not self.insertMode: self.currentLine[self.ptr] = uchar else: - self.currentLine = u"%s%s%s" % (self.currentLine[:self.ptr],uchar,self.currentLine[self.ptr:]) + self.currentLine = "%s%s%s" % (self.currentLine[:self.ptr],uchar,self.currentLine[self.ptr:]) self.ptr += 1 if self.maxLength>0 and self.ptr >= self.maxLength: if self.history != None and self.currentLine: