5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-16 00:49:32 +08:00
wails/v3/examples/events
Lea Anthony 05b16f1d63 Improve Linux application events and refactor app method receivers
This commit includes the addition of common events for the Linux platform. Refactored and standardized the method receivers for the application from 'm' to 'l'. Also, the application startup events in the window example have been updated according to the new naming scheme.
2024-03-06 11:42:19 -06:00
..
assets Improve Linux application events and refactor app method receivers 2024-03-06 11:42:19 -06:00
main.go [v3, assetServer] Remove fs.FS from options and always use a http.Handler 2024-02-16 07:38:27 +01: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