mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
[V3] Add docs for event.Sender (#4075)
* Add docs for event.Sender * Update changelog
This commit is contained in:
parent
a49bfcc956
commit
e75c10d567
3 changed files with 4 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue