refactor(event): add _cb postfix to lv_obj_add_event()
This commit is contained in:
@@ -26,13 +26,13 @@ void lv_example_keyboard_1(void)
|
||||
lv_obj_t * ta;
|
||||
ta = lv_textarea_create(lv_screen_active());
|
||||
lv_obj_align(ta, LV_ALIGN_TOP_LEFT, 10, 10);
|
||||
lv_obj_add_event(ta, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_textarea_set_placeholder_text(ta, "Hello");
|
||||
lv_obj_set_size(ta, 140, 80);
|
||||
|
||||
ta = lv_textarea_create(lv_screen_active());
|
||||
lv_obj_align(ta, LV_ALIGN_TOP_RIGHT, -10, 10);
|
||||
lv_obj_add_event(ta, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_add_event_cb(ta, ta_event_cb, LV_EVENT_ALL, kb);
|
||||
lv_obj_set_size(ta, 140, 80);
|
||||
|
||||
lv_keyboard_set_textarea(kb, ta);
|
||||
|
||||
@@ -16,13 +16,13 @@ kb = lv.keyboard(lv.screen_active())
|
||||
ta = lv.textarea(lv.screen_active())
|
||||
ta.set_width(200)
|
||||
ta.align(lv.ALIGN.TOP_LEFT, 10, 10)
|
||||
ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
ta.add_event_cb(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
ta.set_placeholder_text("Hello")
|
||||
|
||||
ta = lv.textarea(lv.screen_active())
|
||||
ta.set_width(200)
|
||||
ta.align(lv.ALIGN.TOP_RIGHT, -10, 10)
|
||||
ta.add_event(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
ta.add_event_cb(lambda e: ta_event_cb(e,kb), lv.EVENT.ALL, None)
|
||||
|
||||
kb.set_textarea(ta)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user