diff --git a/tutorials/building_a_simple_web_blog_with_vweb/README.md b/tutorials/building_a_simple_web_blog_with_vweb/README.md index 39cb300416e0d1..f44be8fee36282 100644 --- a/tutorials/building_a_simple_web_blog_with_vweb/README.md +++ b/tutorials/building_a_simple_web_blog_with_vweb/README.md @@ -417,8 +417,8 @@ Run v -d use_openssl -o blog -prod . && strip ./blog ``` -This will result in a ~400KB binary. `-d use_openssl` tells vweb to link to OpenSSL. Without this flag mbedtls will be embedded, and the -binary size will increase to ~700KB. +This will result in a ~400KB binary. `-d use_openssl` tells vweb to link to OpenSSL. +Without this flag mbedtls will be embedded, and the binary size will increase to ~700KB. ### To be continued... diff --git a/vlib/gg/gg.c.v b/vlib/gg/gg.c.v index 7a426eec0b232d..fb288ca50d1db4 100644 --- a/vlib/gg/gg.c.v +++ b/vlib/gg/gg.c.v @@ -70,8 +70,9 @@ pub: cleanup_fn FNCb = unsafe { nil } fail_fn FNFail = unsafe { nil } // - event_fn FNEvent = unsafe { nil } - quit_fn FNEvent = unsafe { nil } + event_fn FNEvent = unsafe { nil } + on_event FNEvent2 = unsafe { nil } + quit_fn FNEvent = unsafe { nil } // keydown_fn FNKeyDown = unsafe { nil } keyup_fn FNKeyUp = unsafe { nil } @@ -353,6 +354,8 @@ fn gg_event_fn(ce voidptr, user_data voidptr) { } if ctx.config.event_fn != unsafe { nil } { ctx.config.event_fn(e, ctx.config.user_data) + } else if ctx.config.on_event != unsafe { nil } { + ctx.config.on_event(ctx.config.user_data, e) } match e.typ { .mouse_move { diff --git a/vlib/gg/gg.v b/vlib/gg/gg.v index 203d0d5d5ec722..67bb9e93c4aafa 100644 --- a/vlib/gg/gg.v +++ b/vlib/gg/gg.v @@ -9,6 +9,8 @@ pub type FNCb = fn (data voidptr) pub type FNEvent = fn (e &Event, data voidptr) +pub type FNEvent2 = fn (data voidptr, e &Event) + pub type FNFail = fn (msg string, data voidptr) pub type FNKeyDown = fn (c KeyCode, m Modifier, data voidptr)