Description
I have created a calendar on a window popup. Is there a cancel option to close it? If not what would be the bext way of closing/deleting the window?
What MCU/Processor/Board and compiler are you using?
Simuator
What LVGL version are you using?
8.1
What do you want to achieve?
As described
What have you tried so far?
Selecting the date and using the callback but I’d like an X button somewhere…
Code to reproduce
void cb_setLeavingDate(lv_event_t * event)
{
lv_obj_t * cont = lv_win_get_content(holidy_mode_window); /*Content can be added here*/
lv_obj_t * calendar = lv_calendar_create(cont);
lv_obj_set_size(calendar, 385, 385);
lv_obj_align(calendar, LV_ALIGN_CENTER, 0, 0);
lv_obj_add_event_cb(calendar, cb_calendar_leavingDate, LV_EVENT_ALL, NULL);
lv_calendar_set_today_date(calendar, 2022, 03, 8);
lv_calendar_set_showed_date(calendar, 2022, 03);
/*Highlight a few days*/
static lv_calendar_date_t highlighted_days[1]; /*Only its pointer will be saved so should be static*/
highlighted_days[0].year = 2021;
highlighted_days[0].month = 03;
highlighted_days[0].day = 8;
lv_calendar_set_highlighted_dates(calendar, highlighted_days, 3);
lv_calendar_header_arrow_create(calendar);
lv_calendar_set_showed_date(calendar, 2022, 3);
}