- Window Using zserge/webview
import (
"fmt"
"net/url"
"github.com/zserge/webview"
)
// Window represents a plot window.
type Window struct {
view webview.WebView
}
// Show loads given html source and renders the window.
func (win *Window) Show(html string) {
uri := fmt.Sprintf("data:text/html,%s", url.PathEscape(html))
win.view = webview.New(webview.Settings{
Resizable: true,
URL: uri,
})
win.view.Run()
}