1def event_handler(e): 2 code = e.get_code() 3 obj = e.get_target() 4 if code == lv.EVENT.VALUE_CHANGED: 5 option = " "*10 # should be large enough to store the option 6 obj.get_selected_str(option, len(option)) 7 # .strip() removes trailing spaces 8 print("Option: \"%s\"" % option.strip()) 9 10# Create a normal drop down list 11dd = lv.dropdown(lv.scr_act()) 12dd.set_options("\n".join([ 13 "Apple", 14 "Banana", 15 "Orange", 16 "Cherry", 17 "Grape", 18 "Raspberry", 19 "Melon", 20 "Orange", 21 "Lemon", 22 "Nuts"])) 23 24dd.align(lv.ALIGN.TOP_MID, 0, 20) 25dd.add_event_cb(event_handler, lv.EVENT.ALL, None) 26 27