# Screen change due to delete something

**URL:** <http://forum.squareline.io/t/screen-change-due-to-delete-something/5245>\
**Category:** Uncategorized\
**Created:** [December 23, 2024, 2:39pm UTC](http://forum.squareline.io/t/screen-change-due-to-delete-something/5245 "2024-12-23T14:39:30Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![twig](http://forum.squareline.io/letter_avatar_proxy/v4/letter/t/5daacb/32.png) [@twig](http://forum.squareline.io/u/twig)\
**Post date:** [December 23, 2024, 2:39pm UTC](http://forum.squareline.io/t/screen-change-due-to-delete-something/5245/1 "2024-12-23T14:39:30Z")

</div>

Using the screen switching function, objects and events written by oneself will disappear after switching screens. How to solve this problem

---

<div class="post-metadata">

**Author:** ![Hermit](http://forum.squareline.io/user_avatar/forum.squareline.io/hermit/32/971_2.png) [@Hermit](http://forum.squareline.io/u/Hermit)\
**Post date:** [December 24, 2024, 9:52am UTC](http://forum.squareline.io/t/screen-change-due-to-delete-something/5245/2 "2024-12-24T09:52:58Z")

</div>

I guess you’re using temporary screens who delete themselves when another new screen is loaded. (With normal LVGL screens nothing is deleted in these cases, but they remain in memory.) If you need to stick to the use of temporary screens, the solution is to create CALL\_FUNCTION event-actions on the ‘SCREEN\_LOADED’ event-trigger of every screen, and create your extra hand-coded widgets inside those functions. Then every time the screen gets reloaded and recreated, your extra widgets/event-settings will get recreated along with it in the function. You can decide if you want to place and use the functions in ui\_events.c, or if you use ‘don’t export’ flag on CALL\_FUNCTION action, you’ll need to provide those functions externally.
