Get text from textarea on clicking button


I am working on a project in which i need to geting data from text area on clicking button.

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

TFT SPI ILI9341 and esp32

What LVGL version are you using?

V 7 lv_arduino library

What do you want to achieve?

I want to get data frm text area on cinking button

What have you tried so far?

I am bit fimilar to lvgl but a problem here, I create a tab page where i have many text areas, using keyboad i put text in that text areas but when i click on button (in button event handler i call lv_textarea_get_text) the system stucks and restarts

Code to reproduce

const char* data
void event_handler(lv_obj_t * obj, lv_event_t event)
if(event == LV_EVENT_PRESSED)
data = lv_textarea_get_text(ta);
data_check = true; vTaskDelay(1);

Check that ta is a valid pointer to an object and that that object hasn’t been deleted.

I declared ta as global

Is any way to attach some int or id with an object. or any way to compare lvgl objects.

You can use user_data (this set of functions).

i have multiple text areas on page and i assign same keypad to it on click event then how i gat data from these keypads.

it doesnot work

Check that user data is enabled in lv_conf.h.

1 Like