From c12f77caefbb9abf4678996c2c0395483c81d93f Mon Sep 17 00:00:00 2001 From: troido Date: Thu, 6 Sep 2018 15:11:54 +0200 Subject: widget implementations now inherit from superclass --- asciifarm/client/display/textinput.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'asciifarm/client/display/textinput.py') diff --git a/asciifarm/client/display/textinput.py b/asciifarm/client/display/textinput.py index 3b5def2..cb0ed61 100644 --- a/asciifarm/client/display/textinput.py +++ b/asciifarm/client/display/textinput.py @@ -1,20 +1,17 @@ import curses +from .widimp import WidImp -class TextInput: +class TextInput(WidImp): def __init__(self): - self.widget = None self.text = "" self.cursor = 0 - - def setWidget(self, widget): - self.widget = widget - + def setText(self, text, cursor): self.text = text self.cursor = cursor - self.widget.change() + self.change() def update(self, win): width, height = win.getSize() -- cgit