Skip to content
Snippets Groups Projects
Commit d6dc694d authored by iggy's avatar iggy
Browse files

debugging ctx crash

parent 6a811c0d
No related branches found
No related tags found
No related merge requests found
......@@ -121,7 +121,7 @@ class Application():
e.set_enabled(enabled)
def on_init(self):
print("nothing")
print("nothing to init")
pass
def on_foreground(self):
......@@ -137,7 +137,7 @@ class Application():
pass
def main_foreground(self):
print("nothing")
#print("nothing")
pass
def main_always(self):
......
......@@ -4,6 +4,9 @@ import math
import time
from math import sin,cos,pi
import micropython
import gc
WIDTH = 240
HEIGHT = 240
......@@ -76,6 +79,7 @@ class Icon(UIElement):
super().__init__()
def _draw(self,pos):
print("ui.Icon._draw()")
x = int(pos[0])
y = int(pos[1])
......@@ -89,6 +93,8 @@ class Icon(UIElement):
y-hs/2,
hs,hs,hs//2
).fill()
print(" arc")
self.ctx.move_to(x,y).rgb(self.bg_r,self.bg_g,self.bg_b).arc(x,y,self.size/2,-math.pi,math.pi,True).fill()
#self.ctx.move_to(x,y-self.size/2).rgb(self.bg_r,self.bg_g,self.bg_b).
#.round_rectangle(
......@@ -96,8 +102,17 @@ class Icon(UIElement):
# y-self.size/2,
# self.size,self.size,self.size//2
#).fill()
self.ctx.rgb(1,1,1).move_to(x,y).text(self.label)
micropython.mem_info()
gc.collect()
print(self.label)
self.ctx.rgb(1,1,1).move_to(x,y)
micropython.mem_info("data")
print(" moved")
print(" crash here:")
self.ctx.text(self.label)
print(" text")
class IconValue(Icon):
def __init__(self, value=0, *args, **kwargs):
super().__init__(*args, **kwargs)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment