acid-drop

- Hacking the planet from a LilyGo T-Deck using custom firmware
git clone git://git.acid.vegas/acid-drop.git
Log | Files | Refs | Archive | README | LICENSE

lv_example_win_1.py (759B)

      1 def 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 
      8 win = lv.win(lv.scr_act(), 60)
      9 btn1 = win.add_btn(lv.SYMBOL.LEFT, 40)
     10 btn1.add_event_cb(event_handler, lv.EVENT.ALL, None)
     11 win.add_title("A title")
     12 btn2=win.add_btn(lv.SYMBOL.RIGHT, 40)
     13 btn2.add_event_cb(event_handler, lv.EVENT.ALL, None)
     14 btn3 = win.add_btn(lv.SYMBOL.CLOSE, 60)
     15 btn3.add_event_cb(event_handler, lv.EVENT.ALL, None)
     16 
     17 cont = win.get_content()  # Content can be added here
     18 label = lv.label(cont)
     19 label.set_text("""This is
     20 a pretty
     21 long text
     22 to see how
     23 the window
     24 becomes
     25 scrollable.
     26 
     27 
     28 We need
     29 quite some text
     30 and we will
     31 even put
     32 some more
     33 text to be
     34 sure it
     35 overflows.
     36 """)