From aa703dfc3e334a269ddf004fde0f43cdfacfb016 Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Wed, 7 Aug 2019 20:38:16 +0200 Subject: [PATCH] apps/gophers: update to latest gio Signed-off-by: Elias Naur --- apps/go.mod | 2 +- apps/gophers/main.go | 4 ++-- apps/hello/hello.go | 4 ++-- ui/go.sum | 1 - 4 files changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/go.mod b/apps/go.mod index 0eb6792c..e550315b 100644 --- a/apps/go.mod +++ b/apps/go.mod @@ -3,7 +3,7 @@ module gioui.org/apps go 1.12 require ( - gioui.org/ui v0.0.0-20190807181153-dd35a48a61ab + gioui.org/ui v0.0.0-20190807183537-4e005f2bfa1c github.com/google/go-github/v24 v24.0.1 golang.org/x/exp v0.0.0-20190627132806-fd42eb6b336f golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 diff --git a/apps/gophers/main.go b/apps/gophers/main.go index 17b66546..b053e0ef 100644 --- a/apps/gophers/main.go +++ b/apps/gophers/main.go @@ -125,12 +125,12 @@ func (a *App) run() error { a.w.Invalidate() } } - case app.DrawEvent: + case app.UpdateEvent: ops.Reset() cfg = e.Config cs := layout.RigidConstraints(e.Size) a.ui.Layout(&cfg, a.w.Queue(), ops, cs) - a.w.Draw(ops) + a.w.Update(ops) } } } diff --git a/apps/hello/hello.go b/apps/hello/hello.go index 1ca083e7..a9b181b5 100644 --- a/apps/hello/hello.go +++ b/apps/hello/hello.go @@ -45,7 +45,7 @@ func loop(w *app.Window) error { switch e := e.(type) { case app.DestroyEvent: return e.Err - case app.DrawEvent: + case app.UpdateEvent: cfg = e.Config faces.Reset(&cfg) cs := layout.RigidConstraints(e.Size) @@ -55,7 +55,7 @@ func loop(w *app.Window) error { paint.ColorOp{Color: maroon}.Add(ops) material.Stop() text.Label{Material: material, Face: face, Alignment: text.Center, Text: message}.Layout(ops, cs) - w.Draw(ops) + w.Update(ops) } } } diff --git a/ui/go.sum b/ui/go.sum index 40da998d..95fbd5a0 100644 --- a/ui/go.sum +++ b/ui/go.sum @@ -1,4 +1,3 @@ -gioui.org v0.0.0-20190807152134-6e26c92c7553 h1:TEPtJ8ilc4uETV9T6vS69XifDObJqgNEKUBGrPi21Ak= golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9 h1:uc17S921SPw5F2gJo7slQ3aqvr2RwpL7eb3+DZncu3s= golang.org/x/image v0.0.0-20190703141733-d6a02ce849c9/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0= golang.org/x/sys v0.0.0-20190626221950-04f50cda93cb h1:fgwFCsaw9buMuxNd6+DQfAuSFqbNiQZpcgJQAgJsK6k=