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_roller_1.py (660B)

      1 def event_handler(e):
      2     code = e.get_code()
      3     obj = e.get_target()
      4     if code == lv.EVENT.VALUE_CHANGED:
      5         option = " "*10
      6         obj.get_selected_str(option, len(option))
      7         print("Selected month: " + option.strip())
      8 
      9 #
     10 # An infinite roller with the name of the months
     11 #
     12 
     13 roller1 = lv.roller(lv.scr_act())
     14 roller1.set_options("\n".join([
     15     "January",
     16     "February",
     17     "March",
     18     "April",
     19     "May",
     20     "June",
     21     "July",
     22     "August",
     23     "September",
     24     "October",
     25     "November",
     26     "December"]),lv.roller.MODE.INFINITE)
     27 
     28 roller1.set_visible_row_count(4)
     29 roller1.center()
     30 roller1.add_event_cb(event_handler, lv.EVENT.ALL, None)
     31