wailsruntime

package module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 2, 2023 License: GPL-2.0 Imports: 1 Imported by: 0

README

��# wailsruntime

Documentation

Rendered for js/wasm

Index

Constants

This section is empty.

Variables

View Source
var (
	WindowRuntime js.Value = js.Global().Get("window").Get("runtime")
	WindowGo      js.Value = js.Global().Get("window").Get("go")
)

Functions

func AwaitWailsCall

func AwaitWailsCall(pkgName, structName, funcName string, args ...any) []js.Value

Call and await a wails-runtime bound function.

This is best used for go functions which perform shorter operations, since the javascript runtime will be blocked.

func BrowserOpen

func BrowserOpen(url string)

func ClipboardGetText

func ClipboardGetText() string

func ClipboardSetText

func ClipboardSetText(text string) bool

func EventsEmit

func EventsEmit(eventName string, data any)

func EventsOff

func EventsOff(eventName string)

func EventsOn

func EventsOn(eventName string, callback func(args []js.Value) any)

Register a function to be called from javascript.

func EventsOnMultiple

func EventsOnMultiple(eventNames string, maxCnt int, callback func(args []js.Value) any)

func EventsOnce

func EventsOnce(eventName string, callback func(args []js.Value) any)

func ExitApp

func ExitApp()

func Hide

func Hide()

func MainCall

func MainCall(strctName, funcName string, cb func(args []js.Value) any, args ...any) js.Value

Call a wails-runtime bound function in the main package.

func Show

func Show()

func WailsCall

func WailsCall(pkgName, structName, funcName string, cb func(args []js.Value) any, args ...any) js.Value

Call a wails-runtime bound function.

Due to limitations in javascript, we need to await the promise, which is the reason for the callback. ( this could also be fixed if wails exposes an API for their IPC! ;) )

This is best used for go functions which perform longer operations, since the javascript runtime will not be blocked. (http request for example)

func WindowCenter

func WindowCenter()

func WindowFullscreen

func WindowFullscreen()

func WindowGetPosition

func WindowGetPosition() (x, y int)

func WindowGetSize

func WindowGetSize() (width, height int)

func WindowHide

func WindowHide()

func WindowIsFullScreen

func WindowIsFullScreen() bool

func WindowIsMaximised

func WindowIsMaximised() bool

func WindowIsMinimised

func WindowIsMinimised() bool

func WindowMaximise

func WindowMaximise()

func WindowMinimise

func WindowMinimise()

func WindowReload

func WindowReload()

func WindowReloadApp

func WindowReloadApp()

func WindowSetAlwaysOnTop

func WindowSetAlwaysOnTop(flag bool)

func WindowSetDarkTheme

func WindowSetDarkTheme()

func WindowSetLightTheme

func WindowSetLightTheme()

func WindowSetMaxSize

func WindowSetMaxSize(width, height int)

func WindowSetMinSize

func WindowSetMinSize(width, height int)

func WindowSetPosition

func WindowSetPosition(x, y int)

func WindowSetSystemDefaultTheme

func WindowSetSystemDefaultTheme()

func WindowSetTitle

func WindowSetTitle(title string)

func WindowSetbackgroundColor

func WindowSetbackgroundColor(r, g, b, a int8)

func WindowShow

func WindowShow()

func WindowToggleMaximise

func WindowToggleMaximise()

func WindowUnFullScreen

func WindowUnFullScreen()

func WindowUnmaximise

func WindowUnmaximise()

func WindowUnminimise

func WindowUnminimise()

func WindowisNormal

func WindowisNormal() bool

Types

type EnvInfo

type EnvInfo struct {
	BuildType string
	Platform  string
	Arch      string
}

func Environment

func Environment() EnvInfo

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL