```
package main
import (
_ "embed"
"os"
"gioui.org/app"
"gioui.org/font/opentype"
"gioui.org/io/system"
"gioui.org/layout"
"gioui.org/op"
"gioui.org/text"
"gioui.org/unit"
"gioui.org/widget"
"gioui.org/widget/material"
)
//go:embed malgun.ttf
var malgun []byte
func main() {
println("eggtimer")
go func() {
w := app.NewWindow(
app.Title("Egg timer"),
app.Size(unit.Dp(400), unit.Dp(600)),
)
var ops op.Ops
var startButton widget.Clickable
// th := material.NewTheme(gofont.Collection())
// font, err := opentype.Parse(regular.TTF)
font, err := opentype.Parse(malgun)
if err != nil {
panic(err)
}
fonts := []text.FontFace{
{Face: font},
}
th := material.NewTheme(fonts)
for e := range w.Events() {
switch e := e.(type) {
case system.FrameEvent:
gtx := layout.NewContext(&ops, e)
// btn := material.Button(th, &startButton, "Start")
btn := material.Button(th, &startButton, "시작")
btn.Layout(gtx)
e.Frame(gtx.Ops)
}
}
os.Exit(0)
}()
app.Main()
}
```
wono
|
Do you want to delete?