1
0
mirror of https://shylinux.com/x/icebergs synced 2025-05-02 11:37:01 +08:00
This commit is contained in:
bergyu 2022-01-04 16:03:09 +08:00
parent f83447c088
commit 0d93101653

View File

@ -3,29 +3,31 @@ package app
import ( import (
"github.com/webview/webview" "github.com/webview/webview"
"shylinux.com/x/ice" "shylinux.com/x/ice"
kit "shylinux.com/x/toolkits"
) )
var ww *webview.WebView
type app struct { type app struct {
title string `name:"title text" help:"标题"` title string `name:"title text" help:"标题"`
list string `name:"list auto title" help:"应用"` list string `name:"list auto title" help:"应用"`
} }
func (app app) Title(m *ice.Message, arg ...string) { func (app app) Title(m *ice.Message, arg ...string) {
(*w).SetTitle("contexts") (*ww).SetTitle("contexts")
} }
func (app app) List(m *ice.Message, arg ...string) { func (app app) List(m *ice.Message, arg ...string) {
} }
func init() { ice.Cmd("web.chat.app", app{}) } func init() { ice.Cmd("web.chat.app", app{}) }
func Run() {
var ww *webview.WebView
func Run(arg ...string) {
w := webview.New(true) w := webview.New(true)
defer w.Destroy() defer w.Destroy()
ww = &w ww = &w
w.SetTitle("contexts")
w.SetSize(800, 600, webview.HintNone) w.SetSize(800, 600, webview.HintNone)
w.Navigate("http://localhost:9020") w.SetTitle(kit.Select("contexts", arg, 0))
w.Navigate(kit.Select("http://localhost:9020", arg, 1))
w.Run() w.Run()
} }