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_list_1.py (1570B)
1 def event_handler(e): 2 code = e.get_code() 3 obj = e.get_target() 4 if code == lv.EVENT.CLICKED: 5 print("Clicked: list1." + list1.get_btn_text(obj)) 6 7 # Create a list 8 list1 = lv.list(lv.scr_act()) 9 list1.set_size(180, 220) 10 list1.center() 11 12 # Add buttons to the list 13 list1.add_text("File") 14 btn_new = list1.add_btn(lv.SYMBOL.FILE, "New") 15 btn_new.add_event_cb(event_handler,lv.EVENT.ALL, None) 16 btn_open = list1.add_btn(lv.SYMBOL.DIRECTORY, "Open") 17 btn_open.add_event_cb(event_handler,lv.EVENT.ALL, None) 18 btn_save = list1.add_btn(lv.SYMBOL.SAVE, "Save") 19 btn_save.add_event_cb(event_handler,lv.EVENT.ALL, None) 20 btn_delete = list1.add_btn(lv.SYMBOL.CLOSE, "Delete") 21 btn_delete.add_event_cb(event_handler,lv.EVENT.ALL, None) 22 btn_edit = list1.add_btn(lv.SYMBOL.EDIT, "Edit") 23 btn_edit.add_event_cb(event_handler,lv.EVENT.ALL, None) 24 25 list1.add_text("Connectivity") 26 btn_bluetooth = list1.add_btn(lv.SYMBOL.BLUETOOTH, "Bluetooth") 27 btn_bluetooth.add_event_cb(event_handler,lv.EVENT.ALL, None) 28 btn_navig = list1.add_btn(lv.SYMBOL.GPS, "Navigation") 29 btn_navig.add_event_cb(event_handler,lv.EVENT.ALL, None) 30 btn_USB = list1.add_btn(lv.SYMBOL.USB, "USB") 31 btn_USB.add_event_cb(event_handler,lv.EVENT.ALL, None) 32 btn_battery = list1.add_btn(lv.SYMBOL.BATTERY_FULL, "Battery") 33 btn_battery.add_event_cb(event_handler,lv.EVENT.ALL, None) 34 35 list1.add_text("Exit") 36 btn_apply = list1.add_btn(lv.SYMBOL.OK, "Apply") 37 btn_apply.add_event_cb(event_handler,lv.EVENT.ALL, None) 38 btn_close = list1.add_btn(lv.SYMBOL.CLOSE, "Close") 39 btn_close.add_event_cb(event_handler,lv.EVENT.ALL, None) 40