1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/examples/widgets/spinbox/lv_example_spinbox_1.py
Gabor Kiss-Vamosi 7bec13c2b9 update asserts
2021-02-08 09:53:03 +01:00

13 lines
432 B
Python

def event_handler(obj, event):
if event == lv.EVENT.VALUE_CHANGED:
print("Value: %d" % obj.get_value())
elif event == lv.EVENT.CLICKED:
# For simple test: Click the spinbox to increment its value
obj.increment()
spinbox = lv.spinbox(lv.scr_act())
spinbox.set_digit_format(5, 3)
spinbox.step_prev()
spinbox.set_width(100)
spinbox.align(None, lv.ALIGN.CENTER, 0, 0)
spinbox.set_event_cb(event_handler)