diff options
| author | troido <troido@protonmail.com> | 2019-09-18 12:07:58 +0200 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2019-09-18 12:07:58 +0200 |
| commit | b95a08c303c08d955142312a72f0e51a5edcffdf (patch) | |
| tree | 891e612690f6618f85b48dda30a6b89bfa23bf56 /asciifarm/client/display/textinput.py | |
| parent | e2ecd2b2c5b6bc2bc1dbce6f669c96707683313d (diff) | |
cleanup!
Diffstat (limited to 'asciifarm/client/display/textinput.py')
| -rw-r--r-- | asciifarm/client/display/textinput.py | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/asciifarm/client/display/textinput.py b/asciifarm/client/display/textinput.py deleted file mode 100644 index 092386c..0000000 --- a/asciifarm/client/display/textinput.py +++ /dev/null @@ -1,22 +0,0 @@ - -import curses -from .widimp import WidImp - -class TextInput(WidImp): - - def __init__(self): - self.text = "" - self.cursor = -1 - - def setText(self, text, cursor): - self.text = text - self.cursor = cursor - self.change() - - def update(self, win): - width, height = win.getSize() - win.erase() - win.addLine((0, 0), self.text[:width]) - if self.cursor >= 0 and self.cursor <= len(self.text): - win.setAttr((min(self.cursor, width-1), 0), curses.A_REVERSE) - win.noutrefresh() |
