Description
I would like to know how to remove button(and event handler) from List.
and add new button(and event handler) to List.
can someone help.
What MCU/Processor/Board and compiler are you using?
MIMXRT1064DVL6A / MIMXRT1064-EVK / MCUXpresso
What LVGL version are you using?
v8.3
What do you want to achieve?
What have you tried so far?
//remove all button from List
lv_obj_clean(file_List);
//add new button to List and set style to button
for (i=0;i<count; i++ ){
lv_obj_t * guider_ui.items[i] = lv_list_add_btn(guider_ui.file_List, LV_SYMBOL_***, &item_name[i][0]);
lv_obj_add_style(guider_ui.items[i], &style_List_btns, LV_PART_MAIN | LV_STATE_DEFAULT);
}
//add event handler to button
for ( i=0; i<count: i++ ) {
lv_obj_add_event_cb(guider_ui.items[i], file_List_event_handler, LV_EVENT_ALL, ****);
}
repeating the above code several time, then a hard error occurs.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.