1# 2# Create a 2x2 tile view and allow scrolling only in an "L" shape. 3# Demonstrate scroll chaining with a long list that 4# scrolls the tile view when it can't be scrolled further. 5# 6tv = lv.tileview(lv.scr_act()) 7 8# Tile1: just a label 9tile1 = tv.add_tile(0, 0, lv.DIR.BOTTOM) 10label = lv.label(tile1) 11label.set_text("Scroll down") 12label.center() 13 14# Tile2: a button 15tile2 = tv.add_tile(0, 1, lv.DIR.TOP | lv.DIR.RIGHT) 16 17btn = lv.btn(tile2) 18 19label = lv.label(btn) 20label.set_text("Scroll up or right") 21 22btn.set_size(lv.SIZE.CONTENT, lv.SIZE.CONTENT) 23btn.center() 24 25# Tile3: a list 26tile3 = tv.add_tile(1, 1, lv.DIR.LEFT) 27list = lv.list(tile3) 28list.set_size(lv.pct(100), lv.pct(100)) 29 30list.add_btn(None, "One") 31list.add_btn(None, "Two") 32list.add_btn(None, "Three") 33list.add_btn(None, "Four") 34list.add_btn(None, "Five") 35list.add_btn(None, "Six") 36list.add_btn(None, "Seven") 37list.add_btn(None, "Eight") 38list.add_btn(None, "Nine") 39list.add_btn(None, "Ten") 40