fix(examples) align with renamed Micropython APIs (#2338)

Align examples with renames on https://github.com/lvgl/lv_binding_micropython/issues/157
This commit is contained in:
Amir Gonnen
2021-06-30 00:03:07 +03:00
committed by GitHub
parent fcd4aa3924
commit fe4afe8ef2
10 changed files with 11 additions and 11 deletions

View File

@@ -3,7 +3,7 @@ def draw_event_cb(e):
obj = lv.obj.__cast__(e.get_target())
# Add the faded area before the lines are drawn
dsc = lv.obj_draw_part_dsc_t.cast(e.get_param())
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part != lv.PART.ITEMS:
return
if not dsc.p1 or not dsc.p2:

View File

@@ -1,6 +1,6 @@
def draw_event_cb(e):
dsc = lv.obj_draw_part_dsc_t.cast(e.get_param())
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
if dsc.part == lv.PART.TICKS and dsc.id == lv.chart.AXIS.PRIMARY_X:
month = ["Jan", "Febr", "March", "Apr", "May", "Jun", "July", "Aug", "Sept", "Oct", "Nov", "Dec"]
# dsc.text is defined char text[16], I must therefore convert the Python string to a byte_array

View File

@@ -35,7 +35,7 @@ def event_cb(e):
a.y1 = coords.y1 + p.y - 30
a.y2 = coords.y1 + p.y - 10
clip_area = lv.area_t.cast(e.get_param())
clip_area = lv.area_t.__cast__(e.get_param())
lv.draw_rect(a, clip_area, draw_rect_dsc)
elif code == lv.EVENT.RELEASED:

View File

@@ -49,7 +49,7 @@ class ExampleChart_6():
elif code == lv.EVENT.DRAW_PART_END:
# print("EVENT.DRAW_PART_END")
dsc = lv.obj_draw_part_dsc_t.cast(e.get_param())
dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param())
# if dsc.p1 and dsc.p2:
# print("p1, p2", dsc.p1,dsc.p2)
# print("p1.y, p2.y", dsc.p1.y, dsc.p2.y)