1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-14 06:42:58 +08:00
lvgl/examples/widgets/checkbox/lv_checkbox_example_1.py
2021-02-04 14:46:11 +01:00

8 lines
291 B
Python

def event_handler(obj, event):
if event == lv.EVENT.VALUE_CHANGED:
print("State: %s" % ("Checked" if obj.is_checked() else "Unchecked"))
cb = lv.cb(lv.scr_act())
cb.set_text("I agree to terms and conditions.")
cb.align(None, lv.ALIGN.CENTER, 0, 0)
cb.set_event_cb(event_handler)