Switch to gioui

This commit is contained in:
Caleb Gardner
2024-10-17 07:00:17 -05:00
parent 90f47a3456
commit 645f2d8dd9
3 changed files with 47 additions and 114 deletions
+21 -9
View File
@@ -2,9 +2,9 @@ package main
import (
"fmt"
"os"
"cogentcore.org/core/core"
"cogentcore.org/core/events"
"gioui.org/app"
)
const (
@@ -12,11 +12,23 @@ const (
)
func main() {
b := core.NewBody("LinuxPA")
core.NewButton(b).
SetText("This is a test").
OnClick(func(_ events.Event) {
fmt.Println("This is a test")
})
b.RunMainWindow()
go func() {
w := &app.Window{}
if err := ui(w); err != nil {
fmt.Println(err)
}
os.Exit(0)
}()
app.Main()
}
func ui(w *app.Window) error {
for {
switch e := w.Event().(type) {
case app.DestroyEvent:
return e.Err
case app.FrameEvent:
}
}
}