Documentation
¶
Index ¶
- func Bind[T any](w Window, element string, callback func(Event) T)
- func Decode(str string) string
- func Encode(str string) string
- func Exit()
- func GetArg[T any](e Event) (arg T, err error)
- func SetRootFolder(path string)
- func SetTimeout(seconds uint)
- func Wait()
- type Browser
- type Data
- type Event
- type EventType
- type Runtime
- type ScriptOptions
- type Void
- type Window
- func (w Window) Bind(element string, callback func(Event) any)
- func (w Window) Close()
- func (w Window) Destroy()
- func (w Window) GetUrl() string
- func (w Window) IsShown() bool
- func (w Window) Navigate(url string)
- func (w Window) NewWindow()
- func (w Window) Run(script string)
- func (w Window) Script(script string, options ScriptOptions) (resp string, err error)
- func (w Window) SetHide(status bool)
- func (w Window) SetIcon(icon string, icon_type string)
- func (w Window) SetKiosk(enable bool)
- func (w Window) SetMultiAccess(access bool)
- func (w Window) SetPosition(x uint, y uint)
- func (w Window) SetProfile(name string, path string)
- func (w Window) SetRootFolder(path string)
- func (w Window) SetRuntime(runtime Runtime)
- func (w Window) SetSize(width uint, height uint)
- func (w Window) Show(content string) (err error)
- func (w Window) ShowBrowser(content string, browser Browser) (err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bind ¶
Bind binds a specific html element click event with a function. Empty element means all events.
func SetRootFolder ¶
func SetRootFolder(path string)
SetRootFolder sets the web-server root folder path for all windows.
func SetTimeout ¶
func SetTimeout(seconds uint)
SetTimeout sets the maximum time in seconds to wait for the browser to start.
Types ¶
type Event ¶
type ScriptOptions ¶
type Window ¶
type Window uint
func NewWindow ¶
func NewWindow() Window
NewWindow creates a new WebUI window object and returns the window number.
func NewWindowId ¶
func NewWindowId() Window
NewWindowId returns a free window number that can be used with `NewWindow`.
func (Window) Bind ¶
Bind binds a specific html element click event with a function. Empty element means all events.
func (Window) Close ¶
func (w Window) Close()
Close closes the window. The window object will still exist.
func (Window) Destroy ¶
func (w Window) Destroy()
Destroy closes the window and free all memory resources.
func (Window) NewWindow ¶
func (w Window) NewWindow()
NewWindow creates a new webui window object using a specified window number.
func (Window) Script ¶
func (w Window) Script(script string, options ScriptOptions) (resp string, err error)
Script executes JavaScript and returns the response (Make sure the response buffer can hold the response). The default BufferSize is 8KiB.
func (Window) SetKiosk ¶
SetKiosk determines whether Kiosk mode (full screen) is enabled for the window.
func (Window) SetMultiAccess ¶
SetMultiAccess determines whether the window URL can be reused in normal web browsers.
func (Window) SetPosition ¶
SetPosition sets the window position.
func (Window) SetProfile ¶
SetProfile sets the web browser profile to use. An empty `name` and `path` means the default user profile. Needs to be called before `webui_show()`.
func (Window) SetRootFolder ¶
SetRootFolder sets the web-server root folder path for the window.
func (Window) SetRuntime ¶
SetRuntime sets the runtime for .js and .ts files to Deno and Nodejs.