Description
I get a numeric text in a text area through a button matrix pad using the lv_ta_add_text(btnm1_textarea, txt);
I have been trying to convert a text in a text area to a numeric value.
But I don’t know how to read the text in the btnm1_textarea.
What MCU/Processor/Board and compiler are you using?
STM32F7 series
What do you want to achieve?
How can I read the added text in a text area.
What have you tried so far?
Code to reproduce
static lv_obj_t * btnm1_textarea;
static void btnm_event_cb(lv_obj_t * obj, lv_event_t event)
{
if(event == LV_EVENT_CLICKED) {
const char* txt = lv_btnm_get_active_btn_text(obj);
if(txt != NULL)
{
if(strcmp(txt, "OK") == 0)
{
// convert a text in the text area to a numeric value
// save a numeric value to a variable
}
else
{
lv_ta_add_text(btnm1_textarea, txt);
}
...
}