mirror of
https://gitee.com/Lyon1998/pikapython.git
synced 2025-01-15 17:02:53 +08:00
71364445e0
* support event for lvgl * add example for lvgl * adding const * support core-widget for lvgl * add lvgl package
31 lines
997 B
C
31 lines
997 B
C
#include "pika_lvgl_label.h"
|
|
#include "lvgl.h"
|
|
|
|
void pika_lvgl_label___init__(PikaObj* self, PikaObj* parent) {
|
|
lv_obj_t* lv_parent = obj_getPtr(parent, "lv_obj");
|
|
lv_obj_t* lv_obj = lv_label_create(lv_parent);
|
|
obj_setPtr(self, "lv_obj", lv_obj);
|
|
}
|
|
|
|
void pika_lvgl_label_set_long_mode(PikaObj* self, int mode) {
|
|
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
|
lv_label_set_long_mode(lv_obj, mode);
|
|
}
|
|
|
|
void pika_lvgl_label_set_recolor(PikaObj* self, int en) {
|
|
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
|
lv_label_set_recolor(lv_obj, en);
|
|
}
|
|
|
|
void pika_lvgl_label_set_text(PikaObj* self, char* txt) {
|
|
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
|
lv_label_set_text(lv_obj, txt);
|
|
}
|
|
|
|
void pika_lvgl_label_set_style_text_align(PikaObj* self,
|
|
int selector,
|
|
int value) {
|
|
lv_obj_t* lv_obj = obj_getPtr(self, "lv_obj");
|
|
lv_obj_set_style_text_align(lv_obj, value, selector);
|
|
}
|