This commit is contained in:
2019-12-18 15:19:23 +00:00
parent f74f153569
commit 6a30c11edf
+26 -16
View File
@@ -1,27 +1,37 @@
package main package main
import ( import (
"github.com/leaanthony/mewn" "time"
"github.com/wailsapp/wails"
"fyne.io/fyne/app"
"fyne.io/fyne/widget"
) )
func basic() string { func showTime(clock *widget.Label) {
return "Hello World!" formattedTime := time.Now().Format("03:04:05")
clock.SetText(formattedTime)
} }
func main() { func main() {
app := app.New()
js := mewn.String("./frontend/dist/app.js") w := app.NewWindow("Clock")
css := mewn.String("./frontend/dist/app.css") // w.SetContent(widget.NewVBox(
// widget.NewLabel("Hello Fyne!"),
// widget.NewButton("Quit", func() {
// app.Quit()
// }),
// ))
app := wails.CreateApp(&wails.AppConfig{ clock := widget.NewLabel("")
Width: 1024, showTime(clock)
Height: 768, go func() {
Title: "test", t := time.NewTicker(time.Second)
JS: js, for range t.C {
CSS: css, showTime(clock)
Colour: "#131313", }
}) }()
app.Bind(basic) w.SetContent(clock)
app.Run()
w.ShowAndRun()
} }