From e0ceb9f335a57a774434963129717e6c660f5b3e Mon Sep 17 00:00:00 2001 From: inkeliz Date: Fri, 24 Feb 2023 14:32:10 +0000 Subject: [PATCH] app: [WASM] add ViewEvent This change adds ViewEvent for JS/WASM, which returns the HTMLElement which Gio is been rendered, once started. Signed-off-by: inkeliz --- app/os_js.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/os_js.go b/app/os_js.go index 6f0df82c..578c9e8e 100644 --- a/app/os_js.go +++ b/app/os_js.go @@ -22,7 +22,9 @@ import ( "gioui.org/unit" ) -type ViewEvent struct{} +type ViewEvent struct { + Element js.Value +} type contextStatus int @@ -111,6 +113,7 @@ func newWindow(win *callbacks, options []Option) error { w.w.SetDriver(w) w.Configure(options) w.blur() + w.w.Event(ViewEvent{Element: cont}) w.w.Event(system.StageEvent{Stage: system.StageRunning}) w.resize() w.draw(true)