trying to move some 9.1 era code up to 9.5, although the issue is stil the same from 9.2 so figured I might as well go through the pain of pulling it right up to date
I’m struggling with the new more typed structs for objects
previously i was getting the lv_obj_t* to a keyboard btnm elemement so i can manipulate what is highlighted when a screen appears eg
lv_obj_t buttons = (lv_obj_t) &Menu_Keyboard->btnm;
ASSERT(buttons);
lv_keyboard_set_mode ((lv_obj_t*) Menu_Keyboard, LV_KEYBOARD_MODE_USER_2);
lv_buttonmatrix_set_selected_button (buttons, 24); // focus g in the middle of the keyboard
lv_textarea_set_max_length (Menu_Keyboard->ta, Menu_KeyboardEntryMaxLen);
how am i supposed to access what is now essentially the private data I guess?
or something generic like this to find the middle of any object
static lv_coord_t MenuNav_GetXCentre(lv_obj_t* obj)
{
ASSERT(obj);
return obj->coords.x1 + lv_area_get_width(&obj->coords) / 2;
}
static lv_coord_t MenuNav_GetYCentre(lv_obj_t* obj)
{
ASSERT(obj);
return obj->coords.y1 + lv_area_get_height(&obj->coords) / 2;
}