2022-03-12 10:29:25 +01:00
|
|
|
package main
|
|
|
|
|
2022-05-03 20:22:43 +02:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
|
2022-05-12 15:54:16 +02:00
|
|
|
"git.dotya.ml/wanderer/go-xkcdreader/cmd"
|
|
|
|
|
2022-05-03 20:22:43 +02:00
|
|
|
"fyne.io/fyne/v2/app"
|
|
|
|
"fyne.io/fyne/v2/widget"
|
|
|
|
)
|
|
|
|
|
2022-05-07 00:31:44 +02:00
|
|
|
const appGreeting = "welcome to go-xkcdreader"
|
|
|
|
|
2022-05-12 15:54:16 +02:00
|
|
|
var version = cmd.GetShortVersion()
|
2022-05-10 20:41:06 +02:00
|
|
|
|
2022-05-03 20:22:43 +02:00
|
|
|
func main() {
|
2022-05-12 15:54:16 +02:00
|
|
|
cmd.Execute()
|
|
|
|
|
|
|
|
fmt.Println("Starting " + cmd.GetAppName() + " " + getVersion())
|
2022-05-10 20:41:06 +02:00
|
|
|
|
2022-05-03 20:22:43 +02:00
|
|
|
a := app.New()
|
2022-05-12 15:54:16 +02:00
|
|
|
w := a.NewWindow(cmd.GetAppName())
|
2022-05-03 20:22:43 +02:00
|
|
|
|
2022-05-07 00:31:44 +02:00
|
|
|
w.SetContent(makeGreeting())
|
2022-05-03 20:22:43 +02:00
|
|
|
|
|
|
|
w.ShowAndRun()
|
|
|
|
|
|
|
|
fmt.Println("Exited")
|
|
|
|
}
|
2022-05-07 00:31:44 +02:00
|
|
|
|
|
|
|
func makeGreeting() *widget.Label {
|
|
|
|
return widget.NewLabel(appGreeting)
|
|
|
|
}
|
2022-05-10 20:41:06 +02:00
|
|
|
|
|
|
|
func getVersion() string {
|
2022-05-12 15:54:16 +02:00
|
|
|
return version
|
2022-05-10 20:41:06 +02:00
|
|
|
}
|