What do you want to achieve?
Working Buttons for an ESP32S Screen, change to screen2
What have you tried so far?
GPT says that this modification will fix the errors.
It does however each time you export UI in SquareLine, even to adjust text position it rewrites the entire UI.C file, removing our fix making me do it each and every time I export UI.
Fixed Code
void ui_event_Button1(lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);
if (event_code == LV_EVENT_CLICKED) {
_ui_screen_change(&ui_SettingScreen, LV_SCR_LOAD_ANIM_NONE, 1, 0, &ui_SettingScreen_screen_init);
}
}
Arduino IDE Error log.
/Users//Documents/Arduino1/Fireplacebackupspj/libraries/ui/src/ui.c: In function 'ui_event_Button1': /Users/gabe/Documents/Arduino1/Fireplacebackupspj/libraries/ui/src/ui.c:127:66: error: unused variable 'target' [-Werror=unused-variable] lv_event_code_t event_code = lv_event_get_code(e);lv_obj_t * target = lv_event_get_target(e);
Squareline UI.C button Code:
void ui_event_Button1( lv_event_t * e) {
lv_event_code_t event_code = lv_event_get_code(e);lv_obj_t * target = lv_event_get_target(e);
if ( event_code == LV_EVENT_CLICKED) {
_ui_screen_change( &ui_SettingScreen, LV_SCR_LOAD_ANIM_NONE, 1, 0, &ui_SettingScreen_screen_init);
}
Screenshot or video
Others
- SquareLine Studio version:
- Operating system:
- Target hardware: