Hello, sorry that it was so schematic, I am attaching a more complete detail of the program. When I use it in the lv_msgbox_create it doesn’t work, it sends unreadable data, but when I use it in the lv_label_create, yes.
Greetings.
const char *textos[19] = { "Ahora", "Mejor hoy", "Datos proporcionados", "Ha conectado a", "Sin conesion a", "SSID Wifi:", "Contraseña", "Nombre red wifi", "Contraseña red wifi", "Pais:", "Idioma", "Guardar", "AVISO", "ERROR", "Registro Wifi OK.", "Registro rechazado.", "Ambos campos obligatorios.", "GBR\nESP", "ENG\nSPA" };
char *ec_text;
void event_cb(lv_event_t * e) {
lv_obj_t * obj = lv_event_get_current_target(e);
int boton = lv_msgbox_get_active_btn(obj);
lv_msgbox_close(ui_Config_mbox0);
if ( boton == 0) {
if ( !ec_ssid == 0 & !ec_pass == 0 ) {
Wifi_On = escribir_EEPROM(ec_ssid, ec_pass, w_pais, w_idioma);
if (Wifi_On == 1) {
ec_text = textos[14];
Config_mbox1 = lv_msgbox_create(Configurar, "AVISO", ec_text, NULL, true);
lv_obj_align(Config_mbox1, LV_ALIGN_CENTER, 0, 0);
} else {
ec_text = textos[15];
Config_mbox1 = lv_msgbox_create(Configurar, "ERROR", ec_text, NULL, true);
lv_obj_align(Config_mbox1, LV_ALIGN_CENTER, 0, 0);
}
} else {
if (!ec_ssid == 0 || !ec_pass == 0) {
ec_text = textos[13];
Config_mbox1 = lv_msgbox_create(Configurar, "ERROR", ec_text, NULL, true);
lv_obj_align(ui_Config_mbox1, LV_ALIGN_CENTER, 0, 0);
}
}
}
}
void Configurar_screen_init(void) {
Configurar = lv_obj_create(NULL);
lv_obj_clear_flag(Configurar, LV_OBJ_FLAG_SCROLLABLE);
Config_Label2 = lv_label_create(Configurar);
lv_obj_set_width(Config_Label2, LV_SIZE_CONTENT);
lv_obj_set_height(Config_Label2, LV_SIZE_CONTENT);
lv_obj_set_x(Config_Label2, -96);
lv_obj_set_y(Config_Label2, -59);
lv_obj_set_align(Config_Label2, LV_ALIGN_CENTER);
ec_text = textos[5];
lv_label_set_text(Config_Label2, ec_text); //"SSID Wifi:"
}