Load lv_obj_t * obj but don't display it yet


Similar to how screens are loaded, I was wondering if there’s a similar thing in normal objects other than screens. In screen, you create it first thru lv_obj_create(NULL) then load/display it using lv_scr_load(screen). Is this possible in normal LVGL objects?

What MCU/Processor/Board and compiler are you using?

Simulator for now.

What LVGL version are you using?


What do you want to achieve?

To make loading/display object be a two-step flow.

  1. First create it thru lv_xx_create(…) (Or any flag/state/properties updates)
  2. Then display it with a similar API function call to lv_scr_load(…). Instead of scr, I would like it to be a normal object

My aim is that if after Step #1, there’s still a chance for the object to be reverted to either its original (if object is updated and not created) or not be displayed at all and deleted (if object is initially created)

What have you tried so far?

Hiding the object using ‘LV_OBJ_FLAG_HIDDEN’. I know this is the simplest workaround, but I hope there’s a better approach.

Thank you

I can only think of hidden, out of the screen, in the background or inside an object of size 0.
Would also be quite interested in other options :slight_smile: