summaryrefslogtreecommitdiff
path: root/asciifarm/client/display/widget.py
diff options
context:
space:
mode:
authortroido <troido@hotmail.com>2017-12-30 01:35:41 +0100
committertroido <troido@hotmail.com>2017-12-30 01:35:41 +0100
commitb63f38d654814d6be7a56ee7c8c6c6567755e0b4 (patch)
tree8cc169590bccda80f1d3d246166f002d84cb5fba /asciifarm/client/display/widget.py
parent29149f398986620cf13ba1fc4d2d7cca139bead0 (diff)
tried a new approach to remove code duplication in display
Diffstat (limited to 'asciifarm/client/display/widget.py')
-rw-r--r--asciifarm/client/display/widget.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/asciifarm/client/display/widget.py b/asciifarm/client/display/widget.py
new file mode 100644
index 0000000..ef28d50
--- /dev/null
+++ b/asciifarm/client/display/widget.py
@@ -0,0 +1,30 @@
+
+
+
+class Widget:
+
+
+ def __init__(self, impl):
+ self.impl = impl
+ self.impl.setWidget(self)
+
+ self.win = None
+ self.changed = False
+
+ def setWin(self, win):
+ self.win = win
+
+ def getWin(self):
+ return self.win
+
+ def getImpl(self):
+ return self.impl
+
+ def change(self):
+ self.changed = True
+
+ def update(self, force=False):
+ if not (force or self.changed) or not self.win:
+ return
+ self.impl.update()
+ self.changed = False