5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-03 23:40:43 +08:00
wails/v3/examples/events
Lea Anthony db61f9f263
Event cancellation for standard listeners.
Major doc updates.
Runtime build tidy up.
Removed redundant default event mappings.
2025-01-27 09:29:22 +11:00
..
assets Refactored Events (#3731) 2024-09-07 16:39:02 +10:00
main.go Event cancellation for standard listeners. 2025-01-27 09:29:22 +11:00
README.md Fix context menu issues. 2023-10-10 21:48:47 +11:00

Events Example

This example is a demonstration of using the new events API. It has 2 windows that can emit events from the frontend and the backend emits an event every 10 seconds. All events emitted are logged either to the console or the window.

It also demonstrates the use of RegisterHook to register a function to be called when an event is emitted. For one window, it captures the WindowClosing event and prevents the window from closing twice. The other window uses both hooks and events to show the window is gaining focus.

Running the example

To run the example, simply run the following command:

go run main.go

Status

Platform Status
Mac
Windows Working
Linux