Tagging
Try bookmarklet. Easy tagging.
Do you want to delete?
Do you want to modify?
  • LINKTAG
  • New
  • Tag
  • Comment
  • Tag, gio
Sign in

gio

golang gui gio

Overview

Delightful GUI in Go
wono | discuss |
golang gio font

~eliasnaur/gio#400: body2 中文编码问题 — sourcehut todo

``` 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 | discuss |
golang gui gio

Immediate Mode GUI Programming

Articles and programs by Elias Naur
wono | discuss |
© 2025. LINKTAG.ORG. Help Feedback Privacy Terms