1def 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 13roller1 = lv.roller(lv.scr_act()) 14roller1.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 28roller1.set_visible_row_count(4) 29roller1.center() 30roller1.add_event_cb(event_handler, lv.EVENT.ALL, None) 31 32