We need to change
lv_calendar_set_highlighted_dates prototype on lvgl sources.
If instead of
lv_calendar_date_t *highlighted, set_highlighted_dates received
lv_calendar_date_t highlighted, then the Micropython Binding would recognize this as an array and allow you use a python list.
This is done, for example, on chart where
lv_coord_t y_array is passed as a function argument.
void lv_chart_set_points(lv_obj_t * chart, lv_chart_series_t * ser, lv_coord_t y_array);
and you can do this in Micropython:
Another example is
lv_line_set_points where each element is a
You can do something like this:
l = lv.line(scr)
@kisvegabor - Can we change
lv_calendar_set_highlighted_dates prototype to receive an array? Can you think of other examples where we should receive an array instead of a pointer to struct?
The Micropython Binding is scanning the preprocessed lvgl headers.
This means it can’t process any macros, comments, etc.
A workaround for this is to define a function in addition to a macro that wraps the macro.
The function can be
static inline so it wouldn’t cost anything in C, but it would still be visible to the binding script.
I suggest collecting a list of macros which are important to Micropython, and make a PR with corresponding static inline functions to lvgl repo.
Yes, as I mentioned arrays are supported. See this example.
I think the online simulator is based on older code, before arrays support was added.
But you can check this using the unix (linux) port of