Thank you very much!
Probably I’m over complicating it and thinking to C-ish, but the full scenario is to store arbitrary data (the a
array in the example) in some objects and get them them later. In C I added an event handler and passed the pointer to the custom data as user_data
. And with a custom event code, e.g. LV_EVENT_GET_MY_DATA
I set it in the event parameter. Like:
static int my_data = 10;
lv_obj_add_event_cb(obj, obj_event_handler, LV_EVENT_GET_MY_DATA, &my_data);
void * p;
lv_event_send(obj, LV_EVENT_GET_MY_DATA, &p);
void obj_event_handler(e) {
lv_obj_t * obj = lv_event_get_target(e);
void ** p = lv_event_get_param(e);
void * d = lv_obj_get_event_user_data(obj, obj_event_handler);
*p = d;
}
Quite cumbersome but at least flexible.
I wonder if in MP we can do something like:
btn1.new_memer = my_array
I tried a few things that should work in normal Python, but seemingly they don’t work in MP. 