refactor(event): add _cb postfix to lv_obj_add_event()
This commit is contained in:
@@ -13,15 +13,15 @@ void lv_example_win_1(void)
|
||||
lv_obj_t * win = lv_win_create(lv_screen_active());
|
||||
lv_obj_t * btn;
|
||||
btn = lv_win_add_button(win, LV_SYMBOL_LEFT, 40);
|
||||
lv_obj_add_event(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
lv_win_add_title(win, "A title");
|
||||
|
||||
btn = lv_win_add_button(win, LV_SYMBOL_RIGHT, 40);
|
||||
lv_obj_add_event(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
btn = lv_win_add_button(win, LV_SYMBOL_CLOSE, 60);
|
||||
lv_obj_add_event(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
lv_obj_add_event_cb(btn, event_handler, LV_EVENT_CLICKED, NULL);
|
||||
|
||||
lv_obj_t * cont = lv_win_get_content(win); /*Content can be added here*/
|
||||
lv_obj_t * label = lv_label_create(cont);
|
||||
|
||||
@@ -7,12 +7,12 @@ def event_handler(e):
|
||||
|
||||
win = lv.win(lv.screen_active())
|
||||
button1 = win.add_button(lv.SYMBOL.LEFT, 40)
|
||||
button1.add_event(event_handler, lv.EVENT.ALL, None)
|
||||
button1.add_event_cb(event_handler, lv.EVENT.ALL, None)
|
||||
win.add_title("A title")
|
||||
button2=win.add_button(lv.SYMBOL.RIGHT, 40)
|
||||
button2.add_event(event_handler, lv.EVENT.ALL, None)
|
||||
button2.add_event_cb(event_handler, lv.EVENT.ALL, None)
|
||||
button3 = win.add_button(lv.SYMBOL.CLOSE, 60)
|
||||
button3.add_event(event_handler, lv.EVENT.ALL, None)
|
||||
button3.add_event_cb(event_handler, lv.EVENT.ALL, None)
|
||||
|
||||
cont = win.get_content() # Content can be added here
|
||||
label = lv.label(cont)
|
||||
|
||||
Reference in New Issue
Block a user