I’m sorry but I don’t think there is a way currently to do this unfortunately. Unless @kisvegabor or @embeddedt have any suggestions? The reason it is crashing is because the map[] array needs to be static or global as it is used by reference and not copied to the widgets internals. It’s not elegant but if you have a finite number of ‘__lightNames’ you could define multiple static maps and assign those?
Thanks for looking into this for me. Unfortunately I do not know beforehand what these names might be. They are supplied by the user using a web form and can be anything. I’d rather not have to pre-think of all of the names and create arrays for every possibility and then re-compile when another name comes up.
If the only option I have would be on initialization then when the form is saved I can reboot the ESP but being able to change the names dynamically would be great.
So the solution is mostly working but I have a slight problem in that I end up with C? instead of the string > char that is specified. It’s probably something I’m missing.
I’m using the Arduino environment for the ESP32 and have the following:
char __lightName[sizeof(lightName)];
lightName.toCharArray(__lightName, sizeof(lightName));
/* Code to update tab when __lightName is changed... */
lv_tabview_t *tvp = (lv_tabview_t *)tv;
tvp->map[4] = __lightName;
lv_obj_invalidate(tv);
FYI, in v9 I’m considering to use real buttons (not button matrix) for the tab buttons which will provide much more flexibility. (Even the opportunity to add icons).