mirror of
https://github.com/vlang/v.git
synced 2025-08-03 09:47:15 -04:00
gg: fn (data voidptr, e &Event) for events, allows methods
This commit is contained in:
parent
fc69b2fdb1
commit
399af6768d
@ -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...
|
||||
|
@ -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 {
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user