diff --git a/docs/src/content/docs/changelog.mdx b/docs/src/content/docs/changelog.mdx index f8a3496e3..fd810d4c4 100644 --- a/docs/src/content/docs/changelog.mdx +++ b/docs/src/content/docs/changelog.mdx @@ -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 diff --git a/docs/src/content/docs/learn/events.mdx b/docs/src/content/docs/learn/events.mdx index fcfe6b16c..c21d772df 100644 --- a/docs/src/content/docs/learn/events.mdx +++ b/docs/src/content/docs/learn/events.mdx @@ -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 diff --git a/v3/pkg/application/events.go b/v3/pkg/application/events.go index 87dfef445..973c3015c 100644 --- a/v3/pkg/application/events.go +++ b/v3/pkg/application/events.go @@ -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 }