I have created a component and have it at the top of 3 screens, I have exported all the files, ensured that the includes are there for the ui.h, ui_helpers.h, and ui_comp.h in my main.cpp (in platformio). I can address the lebels, change their text, etc outside of the component like normal. However I cant seem to get to the child items on the component. I have tried using the following code to set the temprature on a label in the component inside the panel:
lv_obj_t * child = ui_comp_get_child(ui_PnlTemp, UI_COMP_PNLTEMP_TXTTEMP);
lv_label_set_text(child,String(curtemp).c_str());
and get no errors till the very end of the compile with :
“undefined reference to `ui_comp_get_child(_lv_obj_t*, unsigned int)” although there is no intellisense errors, squiggles, etc… all looks good in platformio until just as its linking the firmware.elf then poof the error… Can somone assist with what im doing incorrectly. have tried all i can think of…
Ill give that a shot, although i can verify that if i remove the include, then the intellisense will scream and put squiggles under the code. (as buggy as intellisense is) also when i start to specify the components, the autocomplete sees the component function and the children described in the .h file. so im pretty certain that its good, but ill test that anyways… I moved on and did the project another way as i need to finish it, so ill open up the saved project that was giving me issues and try that later today…
it’s not a compiler problem, I compile with arduino and the same strange thing happens, it’s a SLS problem. I ask for help with the same problem, thanks.
I found the “issue”.
Its you just can’t reference the components nor the childens with its variable name cui_var_name_xxx etc just like the other lv_obj objects.
You have to get them with the function lv_obj_get_child(obj_name, num_id_child).
Note:
Its easier to work with widgets throught their var name directly, if theres other ways to work with the components than with lv_obj_get_child hit me up.
Thanks Marian, somehow this makes sense to me, but cast did not help. Even when using a straight numeral here. Would expect compiler to note this before linker runs into problems. Maybe I am missing something here.