summaryrefslogtreecommitdiff
path: root/wasp/apps/testapp.py
diff options
context:
space:
mode:
authorDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-08 23:16:30 (GMT)
committerDaniel Thompson <daniel@redfelineninja.org.uk>2020-03-08 23:16:30 (GMT)
commit5413d826d7ffe825b759cd013f9f68e9311aee01 (patch)
treeb4d111931455dffc8a3ea7e4bab219ad856072c3 /wasp/apps/testapp.py
parent24438ad05daae80c4d27c6e8d0345bfd61d5578b (diff)
wasp: Re-factor how Draw565 is used.
Moving it from applications into the watch is useful for two reasons. Firstly it means applications don't need to know as much about the display color depth and secondly it makes it easier to replace the drawing routines with wasptool.
Diffstat (limited to 'wasp/apps/testapp.py')
-rw-r--r--wasp/apps/testapp.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/wasp/apps/testapp.py b/wasp/apps/testapp.py
index 7bbfc2c..56a3853 100644
--- a/wasp/apps/testapp.py
+++ b/wasp/apps/testapp.py
@@ -3,8 +3,6 @@ import widgets
import manager
import machine
-from draw565 import Draw565
-
class TestApp():
"""Simple test application.
"""
@@ -12,7 +10,6 @@ class TestApp():
def __init__(self):
self.tests = ('Touch', 'String')
self.test = self.tests[0]
- self.drawable = Draw565(watch.display)
def foreground(self, system, effect=None):
"""Activate the application."""
@@ -36,7 +33,7 @@ class TestApp():
self.draw()
def touch(self, event):
- draw = self.drawable
+ draw = watch.drawable
if self.test == 'Touch':
draw.string('({}, {})'.format(event[1], event[2]),
0, 108, width=240)
@@ -60,6 +57,6 @@ class TestApp():
"""Redraw the display from scratch."""
watch.display.mute(True)
watch.display.fill(0)
- self.drawable.string('{} test'.format(self.test),
+ watch.drawable.string('{} test'.format(self.test),
0, 6, width=240)
watch.display.mute(False)