From b94119d0938be48c5ebd517ef8160eecf0c93c9e Mon Sep 17 00:00:00 2001 From: Elias Naur Date: Fri, 21 Jun 2019 17:15:44 +0200 Subject: [PATCH] cmd: update to latest API Signed-off-by: Elias Naur --- apps/go.mod | 2 +- apps/gophers/main.go | 8 ++++---- apps/hello/hello.go | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/apps/go.mod b/apps/go.mod index c9a4bb10..97faf148 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-20190621150145-7aa7bb3be408 + gioui.org/ui v0.0.0-20190621151416-0b6dd4efd95e github.com/google/go-github/v24 v24.0.1 golang.org/x/exp v0.0.0-20190321205749-f0864edee7f3 golang.org/x/image v0.0.0-20190321063152-3fc05d484e9f diff --git a/apps/gophers/main.go b/apps/gophers/main.go index 032831d0..55495868 100644 --- a/apps/gophers/main.go +++ b/apps/gophers/main.go @@ -179,7 +179,7 @@ func (a *App) run() error { switch e := e.(type) { case input.Event: a.inputs.Add(e) - if e, ok := e.(key.Chord); ok { + if e, ok := e.(key.ChordEvent); ok { switch e.Name { case key.NameEscape: os.Exit(0) @@ -189,7 +189,7 @@ func (a *App) run() error { } } } - case app.ChangeStage: + case app.StageEvent: if e.Stage >= app.StageRunning { if a.ctxCancel == nil { a.ctx, a.ctxCancel = context.WithCancel(context.Background()) @@ -203,7 +203,7 @@ func (a *App) run() error { a.ctxCancel = nil } } - case *app.Command: + case *app.CommandEvent: switch e.Type { case app.CommandBack: if a.selectedUser != nil { @@ -211,7 +211,7 @@ func (a *App) run() error { e.Cancel = true } } - case app.Draw: + case app.DrawEvent: ops.Reset() a.cfg = e.Config cs := layout.ExactConstraints(a.w.Size()) diff --git a/apps/hello/hello.go b/apps/hello/hello.go index dec20bbe..3108b03f 100644 --- a/apps/hello/hello.go +++ b/apps/hello/hello.go @@ -51,7 +51,7 @@ func loop(w *app.Window) { for w.IsAlive() { e := <-w.Events() switch e := e.(type) { - case app.Draw: + case app.DrawEvent: cfg = e.Config cs := layout.ExactConstraints(w.Size()) ops.Reset()