~eliasnaur/gio

e89277951c942593c27271875ddc6087d03bc185 — Elias Naur 1 year, 1 month ago 59bc001
example/kitchen: add clipboard example

Updates gio#31

Signed-off-by: Elias Naur <mail@eliasnaur.com>
3 files changed, 11 insertions(+), 3 deletions(-)

M example/go.mod
M example/go.sum
M example/kitchen/kitchen.go
M example/go.mod => example/go.mod +1 -1
@@ 3,7 3,7 @@ module gioui.org/example
go 1.13

require (
	gioui.org v0.0.0-20200511111714-23baeff18d75
	gioui.org v0.0.0-20200517171245-59bc001677e2
	github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7
	github.com/go-gl/glfw/v3.3/glfw v0.0.0-20191125211704-12ad95a8df72
	github.com/google/go-github/v24 v24.0.1

M example/go.sum => example/go.sum +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-20200511111714-23baeff18d75 h1:SHkyPzrwOM1YO/oSzndp/fHDgKEL6DViOu73eEddYgs=
gioui.org v0.0.0-20200511111714-23baeff18d75/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
gioui.org v0.0.0-20200517171245-59bc001677e2 h1:Ny8Y4Aq+/PdYlOZ9f/mZkf0+x2dl3Yf2RoUG61XJ00U=
gioui.org v0.0.0-20200517171245-59bc001677e2/go.mod h1:AHI9rFr6AEEHCb8EPVtb/p5M+NMJRKH58IOp8O3Je04=
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7 h1:SCYMcCJ89LjRGwEa0tRluNRiMjZHalQZrVrvTbPh+qw=
github.com/go-gl/gl v0.0.0-20190320180904-bf2b1f2f34d7/go.mod h1:482civXOzJJCPzJ4ZOX/pwvXBWSnzD4OKMdH4ClKGbk=

M example/kitchen/kitchen.go => example/kitchen/kitchen.go +8 -0
@@ 105,10 105,18 @@ func loop(w *app.Window) error {
		select {
		case e := <-w.Events():
			switch e := e.(type) {
			case system.ClipboardEvent:
				lineEditor.SetText(e.Text)
			case system.DestroyEvent:
				return e.Err
			case system.FrameEvent:
				gtx.Reset(e.Queue, e.Config, e.Size)
				for iconButton.Clicked(gtx) {
					w.WriteClipboard(lineEditor.Text())
				}
				for flatBtn.Clicked(gtx) {
					w.ReadClipboard()
				}
				kitchen(gtx, th)
				e.Frame(gtx.Ops)
			}