webview / webview_go

Go language bindings for the webview library.
MIT License
176 stars 27 forks source link

Cannot create new window after destroy #15

Closed dudehook closed 4 months ago

dudehook commented 8 months ago

Hi-

My program creates a webview, and displays some html successfully. I have seen two bad behaviors:

I need to be able to create/destroy webview windows many times during my application. Is this possible?

Webview is constrained to just one function in my code, and is taken right from an example:

func displayEmail(txt string) { // open a viewport and view it w := webview.New(false) defer w.Destroy() w.SetTitle("Email View") w.SetSize(480, 320, webview.HintNone) w.SetHtml(txt) w.Run() }

SteffenL commented 4 months ago

There have been various changes recently in the core webview library that aim to improve this, and I believe this is now possible although it isn't an officially documented use case. See the linked PR.