mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-02 16:06:19 +00:00
example: update gio version
Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+1
-1
@@ -3,7 +3,7 @@ module gioui.org/example
|
||||
go 1.13
|
||||
|
||||
require (
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65
|
||||
gioui.org v0.0.0-20191014143932-b30bf3cef8b1
|
||||
github.com/google/go-github/v24 v24.0.1
|
||||
golang.org/x/exp v0.0.0-20191002040644-a1355ae1e2c3
|
||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
|
||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65 h1:94lyVLRIPhu95x3goGooL3ZxkDZgo9dRgR6Unecwre0=
|
||||
gioui.org v0.0.0-20191013162339-8cd4c2e5de65/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
gioui.org v0.0.0-20191014143932-b30bf3cef8b1 h1:BhetOsT5IaDOb5cLxWNRBhUToU8C1/WI2nb5sTYKDQE=
|
||||
gioui.org v0.0.0-20191014143932-b30bf3cef8b1/go.mod h1:KqFFi2Dq5gYA3FJ0sDOt8OBXoMsuxMtE8v2f0JExXAY=
|
||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||
github.com/golang/protobuf v1.2.0 h1:P3YflyNX/ehuJFLhxviNdFxQPkGK5cDcApsge1SqnvM=
|
||||
|
||||
@@ -23,6 +23,7 @@ import (
|
||||
"gioui.org/app"
|
||||
"gioui.org/gesture"
|
||||
"gioui.org/io/key"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/unit"
|
||||
|
||||
@@ -100,10 +101,10 @@ func (a *App) run() error {
|
||||
a.w.Invalidate()
|
||||
}
|
||||
}
|
||||
case app.DestroyEvent:
|
||||
case system.DestroyEvent:
|
||||
return e.Err
|
||||
case app.StageEvent:
|
||||
if e.Stage >= app.StageRunning {
|
||||
case system.StageEvent:
|
||||
if e.Stage >= system.StageRunning {
|
||||
if a.ctxCancel == nil {
|
||||
a.ctx, a.ctxCancel = context.WithCancel(context.Background())
|
||||
}
|
||||
@@ -116,17 +117,17 @@ func (a *App) run() error {
|
||||
a.ctxCancel = nil
|
||||
}
|
||||
}
|
||||
case *app.CommandEvent:
|
||||
case *system.CommandEvent:
|
||||
switch e.Type {
|
||||
case app.CommandBack:
|
||||
case system.CommandBack:
|
||||
if a.ui.selectedUser != nil {
|
||||
a.ui.selectedUser = nil
|
||||
e.Cancel = true
|
||||
a.w.Invalidate()
|
||||
}
|
||||
}
|
||||
case app.FrameEvent:
|
||||
gtx.Reset(&e.Config, e.Size)
|
||||
case system.FrameEvent:
|
||||
gtx.Reset(e.Config, e.Size)
|
||||
a.ui.Layout(gtx)
|
||||
e.Frame(gtx.Ops)
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"log"
|
||||
|
||||
"gioui.org/app"
|
||||
"gioui.org/io/system"
|
||||
_ "gioui.org/font/gofont"
|
||||
"gioui.org/layout"
|
||||
"gioui.org/text"
|
||||
@@ -33,10 +34,10 @@ func loop(w *app.Window) error {
|
||||
for {
|
||||
e := <-w.Events()
|
||||
switch e := e.(type) {
|
||||
case app.DestroyEvent:
|
||||
case system.DestroyEvent:
|
||||
return e.Err
|
||||
case app.FrameEvent:
|
||||
gtx.Reset(&e.Config, e.Size)
|
||||
case system.FrameEvent:
|
||||
gtx.Reset(e.Config, e.Size)
|
||||
l := th.H1("Hello, Gio")
|
||||
maroon := color.RGBA{127, 0, 0, 255}
|
||||
l.Color = maroon
|
||||
|
||||
@@ -12,6 +12,7 @@ import (
|
||||
"gioui.org/layout"
|
||||
"gioui.org/text"
|
||||
"gioui.org/unit"
|
||||
"gioui.org/io/system"
|
||||
"gioui.org/widget"
|
||||
"gioui.org/widget/material"
|
||||
|
||||
@@ -42,10 +43,10 @@ func loop(w *app.Window) error {
|
||||
for {
|
||||
e := <-w.Events()
|
||||
switch e := e.(type) {
|
||||
case app.DestroyEvent:
|
||||
case system.DestroyEvent:
|
||||
return e.Err
|
||||
case app.FrameEvent:
|
||||
gtx.Reset(&e.Config, e.Size)
|
||||
case system.FrameEvent:
|
||||
gtx.Reset(e.Config, e.Size)
|
||||
kitchen(gtx, th)
|
||||
e.Frame(gtx.Ops)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user