# Component related info needed

**URL:** <http://forum.squareline.io/t/component-related-info-needed/1540>\
**Category:** How to\
**Created:** [July 20, 2023, 1:07pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540 "2023-07-20T13:07:48Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 20, 2023, 1:07pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/1 "2023-07-20T13:07:48Z")

</div>

Hello,  
I have to use **Labels** at different locations on multiple screens. And they all are going to hold the same text.  
For that I created a component and made the duplicate Labels as needed. Now, I want to update the text of all labels belong to particular component at once through code.

Please help to achieve that.

Regards,  
Keshav Aggarwal

- **SquareLine Studio version: 1.3.1**

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [July 20, 2023, 2:43pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/2 "2023-07-20T14:43:41Z")

</div>

For this your require only one label and move it between screens on load.  
Ofcourse in code, Squareline dont support load screen management, only setup event for this.  
Use more or components is waste resources.

---

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 21, 2023, 5:28am UTC](http://forum.squareline.io/t/component-related-info-needed/1540/3 "2023-07-21T05:28:51Z")

</div>

Well, I’m able to change their text values at once from SLS but don’t know how to do it from the code.  
@kisvegabor can you help on this?

---

<div class="post-metadata">

**Author:** ![kisvegabor](http://forum.squareline.io/user_avatar/forum.squareline.io/kisvegabor/32/537_2.png) [@kisvegabor](http://forum.squareline.io/u/kisvegabor)\
**Post date:** [July 21, 2023, 7:43am UTC](http://forum.squareline.io/t/component-related-info-needed/1540/4 "2023-07-21T07:43:00Z")

</div>

From code the only option is call `lv_label_set_text` on all instances. ☹

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [July 21, 2023, 8:23am UTC](http://forum.squareline.io/t/component-related-info-needed/1540/5 "2023-07-21T08:23:11Z")

</div>

For change you need use get child

```auto
lv_label_set_text(ui_comp_get_child(labelcomp, UI_COMP_PANELMENU1_LABEL5),"Service mode BR");

```

---

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 21, 2023, 1:02pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/6 "2023-07-21T13:02:00Z")

</div>

That’s strange.  
So, I’m stuck with similar problem.  
I want to display notification bar on top of all the screens and have to globally update multiple widgets corresponding to notification bar at once.  
It won’t be good approach to manually update notification bars on all screens.

What approach do you suggest?

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [July 21, 2023, 2:01pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/7 "2023-07-21T14:01:17Z")

</div>

As i write before, create only one bar and on every screen change parent of bar in onload func. Simple explain create bar on screen1 and all other leave black place for this bar. On screen switching is ONE bar moved to new showe screen.

---

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 24, 2023, 7:16am UTC](http://forum.squareline.io/t/component-related-info-needed/1540/8 "2023-07-24T07:16:34Z")

</div>

Hello!  
Thanks for replying!  
It’s working. Now I’ll have to change the parent of the panel and load the screen manually. Earlier I was changing screens directly via SLS.  
Hoping SLS team to get this feature added.

Thanks,  
Keshav Aggarwal

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [July 24, 2023, 11:17am UTC](http://forum.squareline.io/t/component-related-info-needed/1540/9 "2023-07-24T11:17:05Z")

</div>

SLS have this event type … create event on screen call user func …

---

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 24, 2023, 1:06pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/10 "2023-07-24T13:06:42Z")

</div>

Already doing the same way.  
Calling this from an Event-

```auto
lv_obj_set_parent(ui_Panel_notification ,screen);
lv_disp_load_scr(screen);

```

---

<div class="post-metadata">

**Author:** ![Marian\_M](http://forum.squareline.io/letter_avatar_proxy/v4/letter/m/4af34b/32.png) [@Marian\_M](http://forum.squareline.io/u/Marian_M)\
**Post date:** [July 24, 2023, 1:17pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/11 "2023-07-24T13:17:11Z")

</div>

I say about this

 ![image](http://forum.squareline.io/uploads/default/original/1X/62ab912917b5c8be50b41fb8de512a2b51d3a7e0.png)  
and only

```auto
lv_obj_set_parent(ui_Panel_notification ,screen);

```

---

<div class="post-metadata">

**Author:** ![Keshav](http://forum.squareline.io/letter_avatar_proxy/v4/letter/k/b5e925/32.png) [@Keshav](http://forum.squareline.io/u/Keshav)\
**Post date:** [July 24, 2023, 1:41pm UTC](http://forum.squareline.io/t/component-related-info-needed/1540/12 "2023-07-24T13:41:45Z")

</div>

Oh. Great!  
I didn’t know about this. Thanks.
