mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt app
This commit is contained in:
parent
8e23a29c0a
commit
f83447c088
31
misc/app/app.go
Normal file
31
misc/app/app.go
Normal file
@ -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()
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user