on peut déborder l'input (mais pas venir corriger le tout début de la ligne…)
This commit is contained in:
parent
e724584faa
commit
5f37b5273c
1 changed files with 5 additions and 1 deletions
|
@ -240,6 +240,10 @@ class Input(Win):
|
||||||
|
|
||||||
def do_command(self, key):
|
def do_command(self, key):
|
||||||
(y, x) = self.win.getyx()
|
(y, x) = self.win.getyx()
|
||||||
|
if x == self.width-1:
|
||||||
|
self.win.delch(0, 0)
|
||||||
|
self.win.move(y, x)
|
||||||
|
x -= 1
|
||||||
try:
|
try:
|
||||||
self.text = self.text[:self.pos]+key.decode('utf-8')+self.text[self.pos:]
|
self.text = self.text[:self.pos]+key.decode('utf-8')+self.text[self.pos:]
|
||||||
self.win.insstr(key)
|
self.win.insstr(key)
|
||||||
|
@ -247,6 +251,7 @@ class Input(Win):
|
||||||
return
|
return
|
||||||
self.win.move(y, x+1)
|
self.win.move(y, x+1)
|
||||||
self.pos += 1
|
self.pos += 1
|
||||||
|
self.refresh()
|
||||||
|
|
||||||
def get_text(self):
|
def get_text(self):
|
||||||
txt = self.text
|
txt = self.text
|
||||||
|
@ -260,7 +265,6 @@ class Input(Win):
|
||||||
self.txt = self.input.gather()
|
self.txt = self.input.gather()
|
||||||
|
|
||||||
def refresh(self):
|
def refresh(self):
|
||||||
# return
|
|
||||||
self.win.noutrefresh()
|
self.win.noutrefresh()
|
||||||
|
|
||||||
def clear_text(self):
|
def clear_text(self):
|
||||||
|
|
Loading…
Reference in a new issue