mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 21:31:39 +08:00
19 lines
651 B
Markdown
19 lines
651 B
Markdown
|
|
### On
|
|
|
|
API:
|
|
`On(eventType events.ApplicationEventType, callback func(event *Event)) func()`
|
|
|
|
`On()` registers an event listener for specific application events. The callback
|
|
function provided will be triggered when the corresponding event occurs. The
|
|
function returns a function that can be called to remove the listener.
|
|
|
|
### RegisterHook
|
|
|
|
API:
|
|
`RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()`
|
|
|
|
`RegisterHook()` registers a callback to be run as a hook during specific
|
|
events. These hooks are run before listeners attached with `On()`. The function
|
|
returns a function that can be called to remove the hook.
|