Button interrupt handler with image


How to make a button with a handler from an image?

What MCU/Processor/Board and compiler are you using?


What LVGL version are you using?


What do you want to achieve?

When you click on the button with the image, get an interrupt and a handler

What have you tried so far?

Code to reproduce

Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
static lv_style_t style;

lv_style_set_radius(&style, LV_STATE_DEFAULT, 5);
lv_style_set_border_width(&style, LV_STATE_DEFAULT, 2);					// Задайте свойство типа целочисленного типа в стиле
lv_style_set_border_color(&style, LV_STATE_DEFAULT, LV_COLOR_WHITE);
lv_style_set_pad_top(&style, LV_STATE_DEFAULT, 7);
lv_style_set_pad_bottom(&style, LV_STATE_DEFAULT, 7);
lv_style_set_pad_left(&style, LV_STATE_DEFAULT, 7);
lv_style_set_pad_right(&style, LV_STATE_DEFAULT, 7);

/Create an object with the new style/
lv_obj_t * obj = lv_img_create(lv_scr_act(), NULL);
lv_obj_add_style(obj, LV_IMG_PART_MAIN, &style);
lv_img_set_src(obj, &Custom_set);
lv_obj_align(obj, NULL, LV_ALIGN_CENTER, 100, -40);

The code block(s) should be formatted like:

/*You code here*/

Screenshot and/or video

If possible, add screenshots and/or videos about the current state.

I suggest you read the documentation and review all available widgets. The one you are interested in is lv_imgbtn

Thanks figured out

It is not clear how to make a handler for clicking on a button-picture

Thanks figured out