mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
Merge pull request #1019 from canardos/dev-6.0
add lv_obj_set_user_data function
This commit is contained in:
commit
a3c08e9985
@ -1980,6 +1980,16 @@ lv_obj_user_data_t * lv_obj_get_user_data(lv_obj_t * obj)
|
||||
{
|
||||
return &obj->user_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the object's user data. The data will be copied.
|
||||
* @param obj pointer to an object
|
||||
* @param data user data
|
||||
*/
|
||||
void lv_obj_set_user_data(lv_obj_t * obj, lv_obj_user_data_t data)
|
||||
{
|
||||
memcpy(&obj->user_data, &data, sizeof(lv_obj_user_data_t));
|
||||
}
|
||||
#endif
|
||||
|
||||
#if LV_USE_GROUP
|
||||
|
@ -919,6 +919,14 @@ void lv_obj_get_type(lv_obj_t * obj, lv_obj_type_t * buf);
|
||||
* @return pointer to the user data
|
||||
*/
|
||||
lv_obj_user_data_t * lv_obj_get_user_data(lv_obj_t * obj);
|
||||
|
||||
/**
|
||||
* Set the object's user data. The data will be copied.
|
||||
* @param obj pointer to an object
|
||||
* @param data user data
|
||||
*/
|
||||
void lv_obj_set_user_data(lv_obj_t * obj, lv_obj_user_data_t data);
|
||||
|
||||
#endif
|
||||
|
||||
#if LV_USE_GROUP
|
||||
|
Loading…
x
Reference in New Issue
Block a user