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:
@@ -1,9 +1,12 @@
|
||||
#include "../../lv_examples.h"
|
||||
#if LV_USE_CALENDAR && LV_BUILD_EXAMPLES
|
||||
|
||||
static void event_handler(lv_obj_t * obj, lv_event_t event)
|
||||
static void event_handler(lv_event_t * e)
|
||||
{
|
||||
if(event == LV_EVENT_VALUE_CHANGED) {
|
||||
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_calendar_date_t date;
|
||||
if(lv_calendar_get_pressed_date(obj, &date)) {
|
||||
LV_LOG_USER("Clicked date: %02d.%02d.%d", date.day, date.month, date.year);
|
||||
|
||||
Reference in New Issue
Block a user