diff options
Diffstat (limited to 'wasp/apps/testapp.py')
| -rw-r--r-- | wasp/apps/testapp.py | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/wasp/apps/testapp.py b/wasp/apps/testapp.py index 9f512f1..af531eb 100644 --- a/wasp/apps/testapp.py +++ b/wasp/apps/testapp.py @@ -1,7 +1,8 @@ -import watch -import widgets -import manager +# SPDX-License-Identifier: LGPL-3.0-or-later +# Copyright (C) 2020 Daniel Thompson + import machine +import wasp class TestApp(): """Simple test application. @@ -11,11 +12,11 @@ class TestApp(): self.tests = ('Touch', 'String') self.test = self.tests[0] - def foreground(self, system, effect=None): + def foreground(self, effect=None): """Activate the application.""" self.on_screen = ( -1, -1, -1, -1, -1, -1 ) self.draw(effect) - system.request_event(manager.EVENT_TOUCH | manager.EVENT_SWIPE_LEFTRIGHT) + wasp.system.request_event(wasp.EVENT_TOUCH | wasp.EVENT_SWIPE_UPDOWN) def background(self): """De-activate the application (without losing state).""" @@ -33,7 +34,7 @@ class TestApp(): self.draw() def touch(self, event): - draw = watch.drawable + draw = wasp.watch.drawable if self.test == 'Touch': draw.string('({}, {})'.format(event[1], event[2]), 0, 108, width=240) @@ -55,8 +56,8 @@ class TestApp(): def draw(self, effect=None): """Redraw the display from scratch.""" - watch.display.mute(True) - watch.drawable.fill() - watch.drawable.string('{} test'.format(self.test), + wasp.watch.display.mute(True) + wasp.watch.drawable.fill() + wasp.watch.drawable.string('{} test'.format(self.test), 0, 6, width=240) - watch.display.mute(False) + wasp.watch.display.mute(False) |
