Documentation
¶
Index ¶
- Constants
- Variables
- func Swig_free(arg1 uintptr)
- func Swig_malloc(arg1 int) (_swig_ret uintptr)
- func Webview_bind(arg1 uintptr, arg2 string, arg3 _swig_fnptr, arg4 uintptr)
- func Webview_create(arg1 int, arg2 uintptr) (_swig_ret uintptr)
- func Webview_destroy(arg1 uintptr)
- func Webview_dispatch(arg1 uintptr, arg2 _swig_fnptr, arg3 uintptr)
- func Webview_eval(arg1 uintptr, arg2 string)
- func Webview_get_native_handle(arg1 uintptr, arg2 Webview_native_handle_kind_t) (_swig_ret uintptr)
- func Webview_get_window(arg1 uintptr) (_swig_ret uintptr)
- func Webview_init(arg1 uintptr, arg2 string)
- func Webview_navigate(arg1 uintptr, arg2 string)
- func Webview_return(arg1 uintptr, arg2 string, arg3 int, arg4 string)
- func Webview_run(arg1 uintptr)
- func Webview_set_html(arg1 uintptr, arg2 string)
- func Webview_set_size(arg1 uintptr, arg2 int, arg3 int, arg4 Webview_hint_t)
- func Webview_set_title(arg1 uintptr, arg2 string)
- func Webview_set_user_agent(arg1 uintptr, arg2 string)
- func Webview_terminate(arg1 uintptr)
- func Webview_unbind(arg1 uintptr, arg2 string)
- type Hint
- type SwigcptrWebview_native_handle_kind_t
- type WebView
- type Webview_hint_t
- type Webview_native_handle_kind_t
Constants ¶
View Source
const ( // Width and height are default size HintNone = 0 // Window size can not be changed by a user HintFixed = 1 // Width and height are minimum bounds HintMin = 2 // Width and height are maximum bounds HintMax = 3 )
Variables ¶
View Source
var Swig_escape_always_false bool
View Source
var Swig_escape_val interface{}
View Source
var WEBVIEW_HINT_FIXED int = _swig_getWEBVIEW_HINT_FIXED()
View Source
var WEBVIEW_HINT_MAX int = _swig_getWEBVIEW_HINT_MAX()
View Source
var WEBVIEW_HINT_MIN int = _swig_getWEBVIEW_HINT_MIN()
View Source
var WEBVIEW_HINT_NONE int = _swig_getWEBVIEW_HINT_NONE()
Functions ¶
func Swig_malloc ¶
func Webview_bind ¶
func Webview_create ¶
func Webview_destroy ¶
func Webview_destroy(arg1 uintptr)
func Webview_dispatch ¶
func Webview_eval ¶
func Webview_get_native_handle ¶
func Webview_get_native_handle(arg1 uintptr, arg2 Webview_native_handle_kind_t) (_swig_ret uintptr)
func Webview_get_window ¶
func Webview_init ¶
func Webview_navigate ¶
func Webview_run ¶
func Webview_run(arg1 uintptr)
func Webview_set_html ¶
func Webview_set_size ¶
func Webview_set_size(arg1 uintptr, arg2 int, arg3 int, arg4 Webview_hint_t)
func Webview_set_title ¶
func Webview_set_user_agent ¶
func Webview_terminate ¶
func Webview_terminate(arg1 uintptr)
func Webview_unbind ¶
Types ¶
type SwigcptrWebview_native_handle_kind_t ¶
type SwigcptrWebview_native_handle_kind_t uintptr
func (SwigcptrWebview_native_handle_kind_t) Swigcptr ¶
func (p SwigcptrWebview_native_handle_kind_t) Swigcptr() uintptr
type WebView ¶
type WebView interface {
// Run runs the main loop until it's terminated. After this function exits -
// you must destroy the webview.
Run()
// Terminate stops the main loop. It is safe to call this function from
// a background thread.
Terminate()
// Destroy destroys a webview and closes the native window.
Destroy()
// Window returns a native window handle pointer. When using GTK backend the
// pointer is GtkWindow pointer, when using Cocoa backend the pointer is
// NSWindow pointer, when using Win32 backend the pointer is HWND pointer.
Window() unsafe.Pointer
// SetTitle updates the title of the native window. Must be called from the UI
// thread.
SetTitle(title string)
// SetSize updates native window size. See Hint constants.
SetSize(w int, h int, hint Hint)
// URI. Examples:
// w.Navigate("https://github.com/webview/webview")
// w.Navigate("data:text/html,%3Ch1%3EHello%3C%2Fh1%3E")
// w.Navigate("data:text/html;base64,PGgxPkhlbGxvPC9oMT4=")
Navigate(url string)
SetUserAgent(userAgent string)
// SetHtml sets the webview HTML directly.
// Example: w.SetHtml(w, "<h1>Hello</h1>");
SetHtml(html string)
// Init injects JavaScript code at the initialization of the new page. Every
// time the webview will open a the new page - this initialization code will
// be executed. It is guaranteed that code is executed before window.onload.
Init(js string)
// Eval evaluates arbitrary JavaScript code. Evaluation happens asynchronously,
// also the result of the expression is ignored. Use RPC bindings if you want
// to receive notifications about the results of the evaluation.
Eval(js string)
}
func New ¶
New calls NewWindow to create a new window and a new webview instance. If debug is non-zero - developer tools will be enabled (if the platform supports them).
func NewWindow ¶
NewWindow creates a new webview instance. If debug is non-zero - developer tools will be enabled (if the platform supports them). Window parameter can be a pointer to the native window handle. If it's non-null - then child WebView is embedded into the given parent window. Otherwise a new window is created. Depending on the platform, a GtkWindow, NSWindow or HWND pointer can be passed here.
type Webview_hint_t ¶
type Webview_hint_t int
type Webview_native_handle_kind_t ¶
type Webview_native_handle_kind_t interface {
Swigcptr() uintptr
}
Click to show internal directories.
Click to hide internal directories.