fyne/main.go

71 lines
1.1 KiB
Go

package main
/*
This is reference code for toolkit developers
The 'nocui' is a bare minimum toolkit. It's all you need
to interact with the GUI
*/
import (
"runtime"
"fyne.io/fyne/v2/app"
"go.wit.com/log"
)
var PLUGIN string = "fyne"
func blah() {
fynetest()
a.Run()
}
func initPlugin() {
log.Log(INFO, "Init()")
me.myTree = initTree()
me.exit = false
showOptions()
go simpleStdin()
log.Log(INFO, "Init() FYNE END")
// blah()
me.myTree.InitOK()
}
func init() {
// fynetest()
// a.Run()
}
// this must be defined for plugin's, but is never run
// if you build this as a non-plugin, this will run
func main() {
fynetest()
a.Run()
}
// this is called at the very initial connection
// between the app and this gocui plugin
// this is a good place to initialize gocui's default behavior
func toolkitInit() {
log.Log(INFO, "TOOLKIT Init()")
me.exit = false
showOptions()
log.Log(INFO, "TOOLKIT Init() END")
fynetest()
go a.Run()
}
func testmain() {
runtime.LockOSThread() // Ensure main stays on one OS thread
a := app.New()
w := a.NewWindow("Fyne Plugin Fix")
w.ShowAndRun()
// use w.QueueUpdate() to talk to fyne (?)
}