[V3] Add docs for event.Sender (#4075)

* Add docs for event.Sender

* Update changelog
This commit is contained in:
Ian VanSchooten 2025-02-14 15:17:47 -05:00 committed by GitHub
commit e75c10d567
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -92,6 +92,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- In JS/TS bindings, named types are never rendered as aliases for other named types; the old behaviour is now restricted to aliases by [@fbbdev](https://github.com/fbbdev) in [#4045](https://github.com/wailsapp/wails/pull/4045)
- In JS/TS bindings, in class mode, struct fields whose type is a type parameter are marked optional and never initialised automatically by [@fbbdev](https://github.com/fbbdev) in [#4045](https://github.com/wailsapp/wails/pull/4045)
- Update copyright date to 2025 by [@IanVS](https://github.com/IanVS) in [#4037](https://github.com/wailsapp/wails/pull/4037)
- Add docs for event.Sender by [@IanVS](https://github.com/IanVS) in [#4075](https://github.com/wailsapp/wails/pull/4075)
## v3.0.0-alpha.9 - 2025-01-13

View file

@ -445,9 +445,10 @@ app.OnEvent("myevent", func(e *application.CustomEvent) {
// Access event information
name := e.Name // Event name
data := e.Data // Event data
sender := e.Sender // Event sender
sender := e.Sender // Name of the window sending the event, or "" if sent from application
cancelled := e.IsCancelled() // Event cancellation status
})
```
## Event Cancellation

View file

@ -52,7 +52,7 @@ var menuItemClicked = make(chan uint, 5)
type CustomEvent struct {
Name string `json:"name"`
Data any `json:"data"`
Sender string `json:"sender"`
Sender string `json:"sender"` // Name of the window sending the event, or "" if sent from application
cancelled bool
lock sync.RWMutex
}