1def event_handler(e):
2    code = e.get_code()
3    obj = e.get_target()
4    if code == lv.EVENT.CLICKED:
5        print("Button {:d} clicked".format(obj.get_child_id()))
6
7
8win = lv.win(lv.scr_act(), 60)
9btn1 = win.add_btn(lv.SYMBOL.LEFT, 40)
10btn1.add_event_cb(event_handler, lv.EVENT.ALL, None)
11win.add_title("A title")
12btn2=win.add_btn(lv.SYMBOL.RIGHT, 40)
13btn2.add_event_cb(event_handler, lv.EVENT.ALL, None)
14btn3 = win.add_btn(lv.SYMBOL.CLOSE, 60)
15btn3.add_event_cb(event_handler, lv.EVENT.ALL, None)
16
17cont = win.get_content()  # Content can be added here
18label = lv.label(cont)
19label.set_text("""This is
20a pretty
21long text
22to see how
23the window
24becomes
25scrollable.
26
27
28We need
29quite some text
30and we will
31even put
32some more
33text to be
34sure it
35overflows.
36""")
37