mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-07 02:15:34 +00:00
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 <inkeliz@inkeliz.com>
This commit is contained in:
+4
-1
@@ -22,7 +22,9 @@ import (
|
|||||||
"gioui.org/unit"
|
"gioui.org/unit"
|
||||||
)
|
)
|
||||||
|
|
||||||
type ViewEvent struct{}
|
type ViewEvent struct {
|
||||||
|
Element js.Value
|
||||||
|
}
|
||||||
|
|
||||||
type contextStatus int
|
type contextStatus int
|
||||||
|
|
||||||
@@ -111,6 +113,7 @@ func newWindow(win *callbacks, options []Option) error {
|
|||||||
w.w.SetDriver(w)
|
w.w.SetDriver(w)
|
||||||
w.Configure(options)
|
w.Configure(options)
|
||||||
w.blur()
|
w.blur()
|
||||||
|
w.w.Event(ViewEvent{Element: cont})
|
||||||
w.w.Event(system.StageEvent{Stage: system.StageRunning})
|
w.w.Event(system.StageEvent{Stage: system.StageRunning})
|
||||||
w.resize()
|
w.resize()
|
||||||
w.draw(true)
|
w.draw(true)
|
||||||
|
|||||||
Reference in New Issue
Block a user