what's the difference between lv_label_set_text and lv_label_set_text_fmt?

what's the difference between lv_label_set_text and lv_label_set_text_fmt?
1 Reply
melta101
melta1012w ago
isn't that just formatting of the text vs plain txt? @fbiego any chance you can clarify this? https://docs.lvgl.io/master/API/widgets/label/lv_label.html#_CPPv421lv_label_set_text_fmtP8lv_obj_tPKcz https://docs.lvgl.io/master/API/widgets/label/lv_label.html#_CPPv417lv_label_set_textP8lv_obj_tPKc It's what @techielew said above but the format are handled by styles, not objects specifically, plus the the parameter to pass doesnt let it pass styles or format kinda unclear what the explaination well the one sets formatted text and the other sets text with the default format Assume you had a label that could go italic when processing and normal when done. just did some trial and error turns out the "formatted" string wasn't the one i was thinking like itallic, bold etc... it was related to passing variables similar to printf Yes So basically one for concatenation and one for whole strings Makes sense lv_label_set_text makes the label like a string literal(aka we cant change it in runtime as it goes to the read-only memory part) while the other is argument based string(aka we can change it dynamically/runtime)

Did you find this page helpful?