What do you want to achieve?
What have you tried so far?
I create a MsgBox and display it on the screen. How to set the initial focus to a button? How to change the focus of the button, if the button is pressed?
Screenshot or video
Others
- SquareLine Studio version: v8.3.9
- Operating system: Windows 10 Pro
- Target hardware: Intel(R) Core™ i7-9700
Code:
void CreateMsgBoxSet(void)
{
static const char* btns[] = { "Yes", "No", "" };
mboxSet = lv_msgbox_create(NULL, NULL, "Confirm selection.", btns, NULL);
lv_obj_set_style_text_font(mboxSet, &lv_font_montserrat_26, LV_PART_MAIN| LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(mboxSet, lv_palette_main(LV_PALETTE_BLUE_GREY), LV_PART_MAIN);
lv_obj_add_event_cb(mboxSet, event_cbMsgBox, LV_EVENT_ALL, NULL);
lv_obj_align(mboxSet, LV_ALIGN_CENTER, 0, 0);
lv_group_add_obj(g, mboxSet);
}