08-02-2023, 12:58 AM
(This post was last modified: 08-02-2023, 02:03 AM by WhiteHexagon.)
@lupyuen
I got a bit stuck. I am trying to add a gesture event handler to your LVGL featurephone Zig code. I think it is a similar problem that I hit trying to pass the fn() for my interrupt handler over to C. The magic zig spell doesn't seem to be documented, but then what is these days
This code complains the function handle is optional but I dont understand why, or how to fix it. If I pass null for the 'event_cb' param it compiles, so I think that is where the issue is... any ideas please?
error:
I got a bit stuck. I am trying to add a gesture event handler to your LVGL featurephone Zig code. I think it is a similar problem that I hit trying to pass the fn() for my interrupt handler over to C. The magic zig spell doesn't seem to be documented, but then what is these days
This code complains the function handle is optional but I dont understand why, or how to fix it. If I pass null for the 'event_cb' param it compiles, so I think that is where the issue is... any ideas please?
Code:
const handle: ?*c._lv_event_dsc_t = c.lv_obj_add_event_cb(c.lv_scr_act(), eventHandler, c.LV_EVENT_GESTURE, null);
_ = handle;
...
pub fn eventHandler(event: ?*c.lv_event_t) callconv(.C) void {}
error:
Code:
eature-phone.zig:98:1: error: expected type
'*.home....cimport.struct__lv_obj_t'
, found
'?*.home....cimport.struct__lv_obj_t'