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
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 ?
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
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.