cmd: update to latest API

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2019-06-21 17:15:44 +02:00
parent 0b6dd4efd9
commit b94119d093
3 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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
+4 -4
View File
@@ -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())
+1 -1
View File
@@ -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()