mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-14 06:42:58 +08:00
7a23be73ab
Due to spurious enums (https://github.com/lvgl/lv_binding_micropython/issues/199) wrong constant names were generated. Fix these constants.
25 lines
412 B
Python
25 lines
412 B
Python
#
|
|
# Using the Size, Position and Padding style properties
|
|
#
|
|
style = lv.style_t()
|
|
style.init()
|
|
style.set_radius(5)
|
|
|
|
# Make a gradient
|
|
style.set_width(150)
|
|
style.set_height(lv.SIZE_CONTENT)
|
|
|
|
style.set_pad_ver(20)
|
|
style.set_pad_left(5)
|
|
|
|
style.set_x(lv.pct(50))
|
|
style.set_y(80)
|
|
|
|
# Create an object with the new style
|
|
obj = lv.obj(lv.scr_act())
|
|
obj.add_style(style, 0)
|
|
|
|
label = lv.label(obj)
|
|
label.set_text("Hello")
|
|
|