Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
package main
import (
"gioui.org/app"
"gioui.org/font/gofont"
"gioui.org/io/system"
"gioui.org/layout"
"gioui.org/widget"
"gioui.org/widget/material"
)
func main() {
go func() {
gofont.Register()
w := app.NewWindow()
th := material.NewTheme()
gtx := layout.NewContext(w.Queue())
var button widget.Button
for e := range w.Events() {
if e, ok := e.(system.FrameEvent); ok {
gtx.Reset(e.Config, e.Size)
layout.Flex{Axis: layout.Vertical}.Layout(gtx,
layout.Rigid(func() {
th.Button("🗑").Layout(gtx, &button)
}),
)
e.Frame(gtx.Ops)
}
}
}()
app.Main()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.