# Button click event not updating label text

**URL:** <http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526>\
**Category:** Bugs\
**Created:** [July 18, 2023, 10:01pm UTC](http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526 "2023-07-18T22:01:53Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jared](http://forum.squareline.io/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jared](http://forum.squareline.io/u/Jared)\
**Post date:** [July 18, 2023, 10:01pm UTC](http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526/1 "2023-07-18T22:01:53Z")

</div>

### What do you want to achieve?

Label text to update on my hardware as it does in SLS “play mode”

### What have you tried so far?

I added an event to the button to update the label text.  
I tried adding different events for “checked” and “unchecked” but I get the same result. It works in play mode but not on the hardware.

When debugging on the hardware I verified that it’s hitting the line in the ui.c file:  
\_ui\_checked\_set\_text\_value(ui\_LabelStartButton1, target, “STOP”, “START”);

### Screenshot or video

[![](https://img.youtube.com/vi/hf3YCfWfgvc/maxresdefault.jpg "Possible SquareLine Studio bug not updating label text.") ](https://www.youtube.com/watch?v=hf3YCfWfgvc)

### Others

- **SquareLine Studio version:** V1.3.1 LVGL version 8.3.6
- **Operating system:** Windows
- **Target hardware:** STM32F769I-DISCO development board

---

<div class="post-metadata">

**Author:** ![Jared](http://forum.squareline.io/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jared](http://forum.squareline.io/u/Jared)\
**Post date:** [July 19, 2023, 1:24am UTC](http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526/2 "2023-07-19T01:24:43Z")

</div>

Well, I honestly don’t know what happened, but when I build on my home PC it works on my hardware.  
Not sure why it’s not working at my office, but I’m sure it’s not a bug.

---

<div class="post-metadata">

**Author:** ![Jared](http://forum.squareline.io/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jared](http://forum.squareline.io/u/Jared)\
**Post date:** [July 26, 2023, 7:14pm UTC](http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526/3 "2023-07-26T19:14:43Z")

</div>

Ok, I’m back at this. I was tricking myself when I thought it was working correctly when built on another computer.

It’s doing the same regardless of where I build it, but what IS happening is if I switch screens and then switch back to the main again the button text updates properly.

Maybe not a bug and I’m just missing something, but if anyone has any ideas where I should be looking I’d appreciate the help.

---

<div class="post-metadata">

**Author:** ![Jared](http://forum.squareline.io/letter_avatar_proxy/v4/letter/j/848f3c/32.png) [@Jared](http://forum.squareline.io/u/Jared)\
**Post date:** [July 28, 2023, 6:02pm UTC](http://forum.squareline.io/t/button-click-event-not-updating-label-text/1526/4 "2023-07-28T18:02:14Z")

</div>

Figured it out… I needed to “load” the screen not just initialize it.

I was just doing this…  
ui\_ScreenMain\_screen\_init();

I added this right after and all is working well now.  
lv\_disp\_load\_scr(ui\_ScreenMain);
