From f83447c088b384e1565bcb287b6a5ce5cf80bf3e Mon Sep 17 00:00:00 2001 From: bergyu Date: Tue, 4 Jan 2022 11:30:06 +0800 Subject: [PATCH] opt app --- misc/app/app.go | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 misc/app/app.go diff --git a/misc/app/app.go b/misc/app/app.go new file mode 100644 index 00000000..4ef23e3f --- /dev/null +++ b/misc/app/app.go @@ -0,0 +1,31 @@ +package app + +import ( + "github.com/webview/webview" + "shylinux.com/x/ice" +) + +var ww *webview.WebView + +type app struct { + title string `name:"title text" help:"标题"` + list string `name:"list auto title" help:"应用"` +} + +func (app app) Title(m *ice.Message, arg ...string) { + (*w).SetTitle("contexts") +} + +func (app app) List(m *ice.Message, arg ...string) { +} +func init() { ice.Cmd("web.chat.app", app{}) } +func Run() { + w := webview.New(true) + defer w.Destroy() + ww = &w + + w.SetTitle("contexts") + w.SetSize(800, 600, webview.HintNone) + w.Navigate("http://localhost:9020") + w.Run() +}