mirror of
https://github.com/wailsapp/wails.git
synced 2025-05-04 21:31:39 +08:00
![]() * Cleanup bundled runtime entry point * Fix JS representation of Screen struct * Expose IsFocused method in Window interface * Update JS window API * Fix cleanup of WML listeners * Bundle runtime as ES module * Update runtime dependencies * Update runtime types and events * Update bundled runtime * Update changelog --------- Co-authored-by: Lea Anthony <lea.anthony@gmail.com> |
||
---|---|---|
.. | ||
assets | ||
main.go | ||
README.md |
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 |