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
26 lines
910 B
Python
26 lines
910 B
Python
import pika_lvgl as lv
|
|
import PikaStdLib
|
|
mem = PikaStdLib.MemChecker()
|
|
|
|
label1 = lv.label(lv.scr_act())
|
|
LV_LABEL_LONG_WRAP = 0
|
|
label1.set_long_mode(LV_LABEL_LONG_WRAP) # Break the long lines*/
|
|
# Enable re-coloring by commands in the text
|
|
label1.set_recolor(True)
|
|
label1.set_text("#0000ff Re-color# #ff00ff words# #ff0000 of a# label, \
|
|
align the lines to the center and wrap long text automatically.")
|
|
# Set smaller width to make the lines wrap
|
|
label1.set_width(150)
|
|
label1.set_style_text_align(lv.ALIGN.CENTER, 0)
|
|
label1.align(lv.ALIGN.CENTER, 0, -40)
|
|
|
|
LV_LABEL_LONG_SCROLL_CIRCULAR = 3
|
|
label2 = lv.label(lv.scr_act())
|
|
label2.set_long_mode(LV_LABEL_LONG_SCROLL_CIRCULAR) # Circular scroll
|
|
label2.set_width(150)
|
|
label2.set_text("It is a circularly scrolling text. ")
|
|
label2.align(lv.ALIGN.CENTER, 0, 40)
|
|
|
|
print('mem used max: %0.2f kB' % (mem.getMax()))
|
|
print('mem used now: %0.2f kB' % (mem.getNow()))
|