diff --git a/lv_objx/lv_list.c b/lv_objx/lv_list.c index 9da62adda..872203b2d 100644 --- a/lv_objx/lv_list.c +++ b/lv_objx/lv_list.c @@ -133,6 +133,16 @@ lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy) return new_list; } +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_list_clean(lv_obj_t *obj) +{ + lv_obj_t *scrl = lv_page_get_scrl(obj); + lv_obj_clean(scrl); +} + /*====================== * Add/remove functions *=====================*/ diff --git a/lv_objx/lv_list.h b/lv_objx/lv_list.h index 0f1e73140..91366c54d 100644 --- a/lv_objx/lv_list.h +++ b/lv_objx/lv_list.h @@ -76,6 +76,12 @@ typedef enum { */ lv_obj_t * lv_list_create(lv_obj_t * par, lv_obj_t * copy); +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_list_clean(lv_obj_t *obj); + /*====================== * Add/remove functions *=====================*/ diff --git a/lv_objx/lv_page.c b/lv_objx/lv_page.c index 024eea304..ba9e49407 100644 --- a/lv_objx/lv_page.c +++ b/lv_objx/lv_page.c @@ -136,6 +136,16 @@ lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy) return new_page; } +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_page_clean(lv_obj_t *obj) +{ + lv_obj_t *scrl = lv_page_get_scrl(obj); + lv_obj_clean(scrl); +} + /*===================== * Setter functions *====================*/ diff --git a/lv_objx/lv_page.h b/lv_objx/lv_page.h index dea8cabe2..b34cd89f2 100644 --- a/lv_objx/lv_page.h +++ b/lv_objx/lv_page.h @@ -79,6 +79,12 @@ typedef enum { */ lv_obj_t * lv_page_create(lv_obj_t * par, lv_obj_t * copy); +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_page_clean(lv_obj_t *obj); + /** * Get the scrollable object of a page * @param page pointer to a page object diff --git a/lv_objx/lv_tabview.c b/lv_objx/lv_tabview.c index 67a55842c..d737160c2 100644 --- a/lv_objx/lv_tabview.c +++ b/lv_objx/lv_tabview.c @@ -166,6 +166,16 @@ lv_obj_t * lv_tabview_create(lv_obj_t * par, lv_obj_t * copy) return new_tabview; } +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_tabview_clean(lv_obj_t *obj) +{ + lv_obj_t *scrl = lv_page_get_scrl(obj); + lv_obj_clean(scrl); +} + /*====================== * Add/remove functions *=====================*/ diff --git a/lv_objx/lv_tabview.h b/lv_objx/lv_tabview.h index f76a56acc..e6e602cd4 100644 --- a/lv_objx/lv_tabview.h +++ b/lv_objx/lv_tabview.h @@ -83,6 +83,12 @@ typedef enum { */ lv_obj_t * lv_tabview_create(lv_obj_t * par, lv_obj_t * copy); +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_tabview_clean(lv_obj_t *obj); + /*====================== * Add/remove functions *=====================*/ diff --git a/lv_objx/lv_win.c b/lv_objx/lv_win.c index 00202d5a7..9cdc45b50 100644 --- a/lv_objx/lv_win.c +++ b/lv_objx/lv_win.c @@ -137,6 +137,15 @@ lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy) return new_win; } +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_win_clean(lv_obj_t *obj) +{ + lv_obj_t *scrl = lv_page_get_scrl(obj); + lv_obj_clean(scrl); +} /*====================== * Add/remove functions diff --git a/lv_objx/lv_win.h b/lv_objx/lv_win.h index 7de9e416e..ad0b4c8a3 100644 --- a/lv_objx/lv_win.h +++ b/lv_objx/lv_win.h @@ -85,6 +85,11 @@ typedef enum { */ lv_obj_t * lv_win_create(lv_obj_t * par, lv_obj_t * copy); +/** + * Delete all children of the scrl object, without deleting scrl child. + * @param obj pointer to an object + */ +void lv_win_clean(lv_obj_t *obj); /*====================== * Add/remove functions