Missing event in UI_events file

I have a button and create an event to change a container from a default to a user1 image.
This works in squareline, and also in Arduino studio with esp32, this works . But I had to manually define a condition to get the container picture changed in arduino, whereas I thought this would be taken automatically into arduino when we export all files as source code .
There is no event shown (see next :
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.2
// LVGL version: 8.3.11
// Project name: Deurbel

#ifndef _UI_EVENTS_H
#define _UI_EVENTS_H

#ifdef __cplusplus
extern “C” {
#endif

#ifdef __cplusplus
} /extern “C”/
#endif
#endif

What have you tried so far? manual insert in arduino of _ui_state_modify(ui_Container1, LV_STATE_USER_1, _UI_MODIFY_STATE_TOGGLE); but would like to use the defined parts.

How can I verify what is wrong for this missing piece ?

Others

  • SquareLine Studio version:1.4.2
  • Operating system:windows10
  • Target hardware:Arduino IDE/ESP32

You can’t see an ui_events.c file because these ‘built-in’ callbacks are created in ui.c. The ui_events.c file is kept for CALL_FUNCTION actions. (So if you want to customize it and/ore use it from outside, you can create a CALL_FUNCTION action for the event and put the _ui_state_modify toggler code into that function.)
(Nete: I answered the other part of your question here: Change container back to default without button press)

Hi, thank you for your feedback.
Yes, I found them in the ui.c.
but here, you call it functions, not events …why ?
///////////////////// FUNCTIONS ////////////////////
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_PRESSED) {
_ui_image_set_property(ui_Image1, _UI_IMAGE_PROPERTY_IMAGE, & ui_img_bell_rood20x20n_png);
}
if(event_code == LV_EVENT_RELEASED) {
_ui_image_set_property(ui_Image1, _UI_IMAGE_PROPERTY_IMAGE, & ui_img_doorbell_groen_20x20n_png);
}
}

Also, in Arduino, this is not working. What do I need to change/add to get this working in Arduino ?
THank you in advance
regards
Ludo

1 Like

An Event in SquareLine Studio has a ‘Trigger’ and an ‘Action’, as called by the GUI. An action can be called ‘function’ if that’s selected, there’s no discrepancy in the naming.
What do you mean by ‘it’s not working in Arduino’? I guess the compiled binary doesn’t work on your board. There can be many reasons why it’s not working, maybe something related to your touch-screen input. If you’re more specific about the problem and circumstances maybe some more help can be worked out for you.