feat(event) rework the prototype of lv_event_cb
It encapsulates all event related parameters into a single lv_event_t obejct.
This commit is contained in:
@@ -117,7 +117,7 @@ lv_obj_set_event_cb(btn, btn_event_cb); /*Assign a callback to t
|
||||
|
||||
void btn_event_cb(lv_obj_t * btn, lv_event_t event)
|
||||
{
|
||||
if(event == LV_EVENT_CLICKED) {
|
||||
if(code == LV_EVENT_CLICKED) {
|
||||
printf("Clicked\n");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ There are 2 custom pointer that are available in the events:
|
||||
- `user_data`: set when the event is registered.
|
||||
- `event_param`: set when the event is sent in `lv_event_send`
|
||||
|
||||
In any event callback these pointer can be get with `lv_event_get_user_data()` and `lv_event_get_param()`.
|
||||
In any event callback these pointer can be get with `lv_event_get_user_data(e)` and `lv_event_get_param(e)`.
|
||||
|
||||
|
||||
## Event bubbling
|
||||
|
||||
Reference in New Issue
Block a user