Adding object to created group gives assert error.
[Error] (0.280, +24) lv_obj_add_flag: Asserted at expression: obj != NULL (The object is NULL) (in lv_obj.c line #222)
What MCU/Processor/Board and compiler are you using?
What LVGL version are you using?
What do you want to achieve?
I want to user the LV_SYMBOL_KEYBOARD button to move the focus to different objects of the screen. So i wanted to place in a group all the textareas that i wanted switch between them on LV_EVENT_CANCEL
What have you tried so far?
I have identified properly the cancel button when the KEYBOARD button is pressed.
I have tried to assign a lv_group_t* the function that creates the group and then to add the objects inside. When program runs i got this error above.
I have managed to bypass the issue when instead of creating another group i have user the lv_group_get_default() which by hal_init() on simulator is already set and associated with indev. In this case i did not need to add any textareas or dropdown menu in the group. Why ?
But this leaves me with the 3 questions:
Are everything by default added to the default group which is connected with the indev?
I can not create a second group?
Each group has to be assigned to the indev objects of the hal_init() function
Code to reproduce
//formGroup=lv_group_get_default(); // this works
formGroup=lv_group_create(); // this does not work on add of object
// init of textarea
Hmm, as far as I can see (checked it with lvgl simulator and demo app),
the lv_obj_add_flag function is not called in succession of lv_group_add_obj.
lv_obj_add_flag is mainly called on creation of the different widgets.
You are correct i had to check for add_flag and it is not inside the add_object to group.
The event_handler of an event was adding a flag to an object not created at that time.
I have switched the order and i do not have this error.
The only strange thing is the default group does not give this specific behaviour , so when i was not controlling the groups at all then i did not have at all this problem.
So probably the question is change to adding object to default group by framework does not have issue with event handler (i seems normal cause event handlers are created by users later) but when you the group is done by user the event handler is problem maybe it is only problem of order declaration?
I mean if you create the object and add it to the group before you declare the callback.