Low-level MoonBit bindings to webview/webview
fn main {
try! @webview.WebView(debug=true)
..set_title("MoonBit webview")
..set_size(800, 600)
..set_html("<h1>Hello from MoonBit</h1>")
..run()
}moon run src/examples/basic --target nativeoptions(
"is-main": true,
link: {
"native": {
"cc-link-flags": "advapi32.lib ole32.lib shell32.lib shlwapi.lib user32.lib version.lib",
},
},
)pub struct WebView {
// private fields
}
fn WebView::WebView(debug? : Bool) -> WebView raise WebViewErrorfn WebView::bind(self : WebView, name : String, handler : (String, String) -> Unit) -> Unit raise WebViewErrorfn WebView::on_window_event(self : WebView, handler : (WindowEvent) -> Unit) -> Unit raise WebViewErrorfn WebView::return_(self : WebView, id : String, status : Int, result : String) -> Unit raise WebViewErrorfn WebView::set_size(self : WebView, width : Int, height : Int, hint? : SizeHint) -> Unit raise WebViewError