From 346395d039bdfd5d632d86ca2b6fa419bba0a222 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Tue, 18 Feb 2025 21:36:05 +0100 Subject: [PATCH] chore(obj): deprecate lv_obj_find_by_id in favor of lv_obj_find_by_name --- docs/src/details/auxiliary-modules/obj_id.rst | 5 +++-- src/core/lv_obj.h | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/docs/src/details/auxiliary-modules/obj_id.rst b/docs/src/details/auxiliary-modules/obj_id.rst index df9626bc7..00d19fc85 100644 --- a/docs/src/details/auxiliary-modules/obj_id.rst +++ b/docs/src/details/auxiliary-modules/obj_id.rst @@ -190,7 +190,8 @@ that the Widget no longer exists. Find child by ID ---------------- +.. warning:: + ``lv_obj_find_by_id(widget, id)`` is deprecated. To find a widget use ``obj_name``. + :cpp:expr:`lv_obj_find_by_id(widget, id)` will perform a recursive walk through ``widget``\ 's children and return the first child encountered having the given ID. - - diff --git a/src/core/lv_obj.h b/src/core/lv_obj.h index b63f22ef9..21954e993 100644 --- a/src/core/lv_obj.h +++ b/src/core/lv_obj.h @@ -399,6 +399,9 @@ void lv_obj_set_id(lv_obj_t * obj, void * id); void * lv_obj_get_id(const lv_obj_t * obj); /** + * DEPRECATED IDs are used only to print the widget trees. + * To find a widget use `lv_obj_find_by_name` + * * Get the child object by its id. * It will check children and grandchildren recursively. * Function `lv_obj_id_compare` is used to matched obj id with given id.