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_menu_3.py (1021B)

      1 # Create a menu object
      2 menu = lv.menu(lv.scr_act())
      3 menu.set_size(320, 240)
      4 menu.center()
      5 
      6 # Create sub pages
      7 sub_page_1 = lv.menu_page(menu, "Page 1")
      8 
      9 cont = lv.menu_cont(sub_page_1)
     10 label = lv.label(cont)
     11 label.set_text("Hello, I am hiding here")
     12 
     13 sub_page_2 = lv.menu_page(menu, "Page 2")
     14 
     15 cont = lv.menu_cont(sub_page_2)
     16 label = lv.label(cont)
     17 label.set_text("Hello, I am hiding here")
     18 
     19 sub_page_3 = lv.menu_page(menu, "Page 3")
     20 
     21 cont = lv.menu_cont(sub_page_3)
     22 label = lv.label(cont)
     23 label.set_text("Hello, I am hiding here")
     24 
     25 # Create a main page
     26 main_page = lv.menu_page(menu, None)
     27 
     28 cont = lv.menu_cont(main_page)
     29 label = lv.label(cont)
     30 label.set_text("Item 1 (Click me!)")
     31 menu.set_load_page_event(cont, sub_page_1)
     32 
     33 cont = lv.menu_cont(main_page)
     34 label = lv.label(cont)
     35 label.set_text("Item 2 (Click me!)")
     36 menu.set_load_page_event(cont, sub_page_2)
     37 
     38 cont = lv.menu_cont(main_page)
     39 label = lv.label(cont)
     40 label.set_text("Item 3 (Click me!)")
     41 menu.set_load_page_event(cont, sub_page_3)
     42 
     43 menu.set_page(main_page)