Tactiliest/Tactility/Source/lvgl/LabelUtils.cpp
Ken Van Hoeylandt c87200a80d
Project restructuring (fixes macOS builds) (#198)
- Create `Include/` folder for all main projects
- Fix some issues here and there (found while moving things)
- All includes are now in `Tactility/` subfolder and must be included with that prefix. This fixes issues with clashing POSIX headers (e.g. `<semaphore.h>` versus Tactility's `Semaphore.h`)
2025-02-01 18:13:20 +01:00

19 lines
398 B
C++

#include <Tactility/lvgl/LabelUtils.h>
#include <Tactility/file/File.h>
namespace tt::lvgl {
#define TAG "tt_lv_label"
bool label_set_text_file(lv_obj_t* label, const char* filepath) {
auto text = file::readString(filepath);
if (text != nullptr) {
lv_label_set_text(label, (const char*)text.get());
return true;
} else {
return false;
}
}
} // namespace