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