arch(driver): new driver architecture with new color format support
This commit is contained in:
@@ -29,7 +29,7 @@ void lv_example_dropdown_1(void)
|
||||
"Nuts");
|
||||
|
||||
lv_obj_align(dd, LV_ALIGN_TOP_MID, 0, 20);
|
||||
lv_obj_add_event_cb(dd, event_handler, LV_EVENT_ALL, NULL);
|
||||
lv_obj_add_event(dd, event_handler, LV_EVENT_ALL, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
def event_handler(e):
|
||||
code = e.get_code()
|
||||
obj = e.get_target()
|
||||
obj = e.get_target_obj()
|
||||
if code == lv.EVENT.VALUE_CHANGED:
|
||||
option = " "*10 # should be large enough to store the option
|
||||
obj.get_selected_str(option, len(option))
|
||||
@@ -22,5 +22,5 @@ dd.set_options("\n".join([
|
||||
"Nuts"]))
|
||||
|
||||
dd.align(lv.ALIGN.TOP_MID, 0, 20)
|
||||
dd.add_event_cb(event_handler, lv.EVENT.ALL, None)
|
||||
dd.add_event(event_handler, lv.EVENT.ALL, None)
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ void lv_example_dropdown_3(void)
|
||||
/*In a menu we don't need to show the last clicked item*/
|
||||
lv_dropdown_set_selected_highlight(dropdown, false);
|
||||
|
||||
lv_obj_add_event_cb(dropdown, event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
lv_obj_add_event(dropdown, event_cb, LV_EVENT_VALUE_CHANGED, NULL);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -12,7 +12,7 @@ img_caret_down_argb = lv.img_dsc_t({
|
||||
})
|
||||
|
||||
def event_cb(e):
|
||||
dropdown = e.get_target()
|
||||
dropdown = e.get_target_obj()
|
||||
option = " "*64 # should be large enough to store the option
|
||||
dropdown.get_selected_str(option, len(option))
|
||||
print(option.strip() +" is selected")
|
||||
@@ -42,5 +42,5 @@ dropdown.set_style_transform_angle(1800, lv.PART.INDICATOR | lv.STATE.CHECKED)
|
||||
# In a menu we don't need to show the last clicked item
|
||||
dropdown.set_selected_highlight(False)
|
||||
|
||||
dropdown.add_event_cb(event_cb, lv.EVENT.VALUE_CHANGED, None)
|
||||
dropdown.add_event(event_cb, lv.EVENT.VALUE_CHANGED, None)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user