feat(event) add event filter to lv_event_send

This commit is contained in:
Gabor Kiss-Vamosi
2021-04-19 11:15:28 +02:00
parent ddea17afe2
commit bbfcb2454e
43 changed files with 249 additions and 306 deletions
@@ -3,11 +3,8 @@
static void event_cb(lv_event_t * e)
{
lv_event_code_t code = lv_event_get_code(e);
lv_obj_t * obj = lv_event_get_target(e);
if(code == LV_EVENT_VALUE_CHANGED) {
LV_LOG_USER("Button %s clicked", lv_msgbox_get_active_btn_text(obj));
}
LV_LOG_USER("Button %s clicked", lv_msgbox_get_active_btn_text(obj));
}
void lv_example_msgbox_1(void)
@@ -15,7 +12,7 @@ void lv_example_msgbox_1(void)
static const char * btns[] ={"Apply", "Close", ""};
lv_obj_t * mbox1 = lv_msgbox_create("Hello", "This is a message box with two buttons.", btns, true);
lv_obj_add_event_cb(mbox1, event_cb, NULL);
lv_obj_add_event_cb(mbox1, event_cb, LV_EVENT_VALUE_CHANGED, NULL);
lv_obj_center(mbox1);
}