Initial commit; Added xterm window & go backend

This commit is contained in:
2023-03-02 21:34:23 +01:00
commit da00ecf8c1
11 changed files with 547 additions and 0 deletions

27
main.go Normal file
View File

@@ -0,0 +1,27 @@
package main
import (
"io/ioutil"
"time"
"github.com/webview/webview"
)
func main() {
w := webview.New(true)
defer w.Destroy()
w.SetTitle("Basic Example")
w.SetSize(480, 320, webview.HintNone)
b, _ := ioutil.ReadFile("frontend/dist/index.html")
w.SetHtml(string(b))
go func() {
for {
time.Sleep(2 * time.Second)
w.Eval(`window.__WRITE_TERMINAL('PONG!\r\n');`)
}
}()
w.Run()
}