mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-06 18:05:35 +00:00
app: [API] make ViewEvent an interface on all platforms
A uniform type allows convenient nil checks and for future window backends on platforms other than Linux (which already had ViewEvent as an interface). Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+4
-3
@@ -25,7 +25,7 @@ import (
|
||||
"gioui.org/unit"
|
||||
)
|
||||
|
||||
type ViewEvent struct {
|
||||
type JSViewEvent struct {
|
||||
Element js.Value
|
||||
}
|
||||
|
||||
@@ -114,7 +114,7 @@ func newWindow(win *callbacks, options []Option) {
|
||||
|
||||
w.Configure(options)
|
||||
w.blur()
|
||||
w.processEvent(ViewEvent{Element: cont})
|
||||
w.processEvent(JSViewEvent{Element: cont})
|
||||
w.processEvent(StageEvent{Stage: StageRunning})
|
||||
w.resize()
|
||||
w.draw(true)
|
||||
@@ -830,4 +830,5 @@ func translateKey(k string) (key.Name, bool) {
|
||||
return n, true
|
||||
}
|
||||
|
||||
func (_ ViewEvent) ImplementsEvent() {}
|
||||
func (JSViewEvent) implementsViewEvent() {}
|
||||
func (JSViewEvent) ImplementsEvent() {}
|
||||
|
||||
Reference in New Issue
Block a user