1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-21 06:53:01 +08:00
lvgl/examples/widgets/msgbox/lv_example_msgbox_1.py
Uli Raich c60ed68e94
adding micropython examples (#2286)
* adding micropython examples

* adding micropython examples
2021-06-07 13:56:08 +02:00

11 lines
337 B
Python

def event_cb(e):
mbox = lv.msgbox.__cast__(e.get_current_target())
print("Button " + mbox.get_active_btn_text() + " clicked")
btns = ["Apply", "Close", ""]
mbox1 = lv.msgbox(lv.scr_act(), "Hello", "This is a message box with two buttons.", btns, True)
mbox1.add_event_cb(event_cb, lv.EVENT.VALUE_CHANGED, None)
mbox1.center()