diff --git a/examples/widgets/bar/lv_example_bar_6.py b/examples/widgets/bar/lv_example_bar_6.py index fef9e8d36..6c7793afe 100644 --- a/examples/widgets/bar/lv_example_bar_6.py +++ b/examples/widgets/bar/lv_example_bar_6.py @@ -2,7 +2,7 @@ def set_value(bar, v): bar.set_value(v, lv.ANIM.OFF) def 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.INDICATOR: return diff --git a/examples/widgets/bar/test.py b/examples/widgets/bar/test.py index 143afe1d2..4ff17fb44 100644 --- a/examples/widgets/bar/test.py +++ b/examples/widgets/bar/test.py @@ -5,7 +5,7 @@ def set_value(bar, v): bar.set_value(v, lv.ANIM.OFF) def 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.INDICATOR: return diff --git a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py index d5dcee761..8adb570b0 100644 --- a/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py +++ b/examples/widgets/btnmatrix/lv_example_btnmatrix_2.py @@ -22,7 +22,7 @@ def event_cb(e): code = e.get_code() obj = e.get_target() if code == lv.EVENT.DRAW_PART_BEGIN: - dsc = lv.obj_draw_part_dsc_t.cast(e.get_param()) + dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param()) # Change the draw descriptor the 2nd button if dsc.id == 1: dsc.rect_dsc.radius = 0; @@ -50,7 +50,7 @@ def event_cb(e): dsc.label_dsc.opa = lv.OPA.TRANSP # Hide the text if any if code == lv.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()) # Add custom content to the 4th button when the button itself was drawn if dsc.id == 3: diff --git a/examples/widgets/chart/lv_example_chart_2.py b/examples/widgets/chart/lv_example_chart_2.py index 1cd504ddc..e769d14e5 100644 --- a/examples/widgets/chart/lv_example_chart_2.py +++ b/examples/widgets/chart/lv_example_chart_2.py @@ -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: diff --git a/examples/widgets/chart/lv_example_chart_3.py b/examples/widgets/chart/lv_example_chart_3.py index 3d14bd037..a0222ae6f 100644 --- a/examples/widgets/chart/lv_example_chart_3.py +++ b/examples/widgets/chart/lv_example_chart_3.py @@ -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 diff --git a/examples/widgets/chart/lv_example_chart_4.py b/examples/widgets/chart/lv_example_chart_4.py index 981f65feb..906c35a9a 100644 --- a/examples/widgets/chart/lv_example_chart_4.py +++ b/examples/widgets/chart/lv_example_chart_4.py @@ -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: diff --git a/examples/widgets/chart/lv_example_chart_6.py b/examples/widgets/chart/lv_example_chart_6.py index 23d4e4453..6eb89dc52 100644 --- a/examples/widgets/chart/lv_example_chart_6.py +++ b/examples/widgets/chart/lv_example_chart_6.py @@ -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) diff --git a/examples/widgets/slider/lv_example_slider_3.py b/examples/widgets/slider/lv_example_slider_3.py index 792d72a01..550714ddc 100644 --- a/examples/widgets/slider/lv_example_slider_3.py +++ b/examples/widgets/slider/lv_example_slider_3.py @@ -8,7 +8,7 @@ def slider_event_cb(e): elif code == lv.EVENT.DRAW_PART_END: # print("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()) # print(dsc) if dsc.part == lv.PART.INDICATOR: label_text = "{:d} - {:d}".format(obj.get_left_value(),slider.get_value()) diff --git a/examples/widgets/table/lv_example_table_1.py b/examples/widgets/table/lv_example_table_1.py index e035168cd..3fe45fbec 100644 --- a/examples/widgets/table/lv_example_table_1.py +++ b/examples/widgets/table/lv_example_table_1.py @@ -1,6 +1,6 @@ def draw_part_event_cb(e): obj = lv.table.__cast__(e.get_target()) - dsc = lv.obj_draw_part_dsc_t.cast(e.get_param()) + dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param()) # If the cells are drawn../ if dsc.part == lv.PART.ITEMS: row = dsc.id // obj.get_col_cnt() diff --git a/examples/widgets/table/lv_example_table_2.py b/examples/widgets/table/lv_example_table_2.py index 4eb6abe99..5b60befe0 100644 --- a/examples/widgets/table/lv_example_table_2.py +++ b/examples/widgets/table/lv_example_table_2.py @@ -5,7 +5,7 @@ ITEM_CNT = 200 def draw_event_cb(e): obj = lv.table.__cast__(e.get_target()) - dsc = lv.obj_draw_part_dsc_t.cast(e.get_param()) + dsc = lv.obj_draw_part_dsc_t.__cast__(e.get_param()) # If the cells are drawn... if dsc.part == lv.PART.ITEMS: chk = obj.has_cell_ctrl(dsc.id, 0, lv.table.CELL_CTRL.CUSTOM_1)