Documentation ¶
Overview ¶
Package runtime contains all the methods and data structures related to the runtime library of Wails. This includes both Go and JS runtimes.
Index ¶
- Variables
- func ProcessEncoding(text string) string
- type Browser
- type Dialog
- type Events
- func (r *Events) Emit(eventName string, optionalData ...interface{})
- func (r *Events) On(eventName string, callback func(optionalData ...interface{}))
- func (r *Events) OnMultiple(eventName string, callback func(optionalData ...interface{}), counter uint)
- func (r *Events) Once(eventName string, callback func(optionalData ...interface{}))
- type FileSystem
- type Log
- type Options
- type Runtime
- type Store
- type StoreProvider
- type Window
Constants ¶
This section is empty.
Variables ¶
var BridgeJS []byte
var InitJS []byte
var WailsCSS string
var WailsJS string
Functions ¶
func ProcessEncoding ¶
ProcessEncoding attempts to convert CKJ strings to UTF-8
Types ¶
type Browser ¶
type Browser struct{}
Browser exposes browser methods to the runtime
type Dialog ¶
type Dialog struct {
// contains filtered or unexported fields
}
Dialog exposes an interface to native dialogs
func NewDialog ¶
func NewDialog(renderer interfaces.Renderer) *Dialog
NewDialog creates a new Dialog struct
func (*Dialog) SelectDirectory ¶
SelectDirectory prompts the user to select a directory
func (*Dialog) SelectFile ¶
SelectFile prompts the user to select a file
func (*Dialog) SelectSaveFile ¶
SelectSaveFile prompts the user to select a file for saving
type Events ¶
type Events struct {
// contains filtered or unexported fields
}
Events exposes the events interface
func NewEvents ¶
func NewEvents(eventManager interfaces.EventManager) *Events
NewEvents creates a new Events struct
func (*Events) OnMultiple ¶
func (r *Events) OnMultiple(eventName string, callback func(optionalData ...interface{}), counter uint)
OnMultiple pass through
type FileSystem ¶
type FileSystem struct{}
FileSystem exposes file system utilities to the runtime
func (*FileSystem) HomeDir ¶
func (r *FileSystem) HomeDir() (string, error)
HomeDir returns the user's home directory
type Options ¶
type Options struct { // The name of the store Name string // The runtime to attach the store to Runtime *Runtime // Indicates if notifying Go listeners should be notified of updates // synchronously (on the current thread) or asynchronously using // goroutines NotifySynchronously bool }
Options defines the optional data that may be used when creating a Store
type Runtime ¶
type Runtime struct { Events *Events Log *Log Dialog *Dialog Window *Window Browser *Browser FileSystem *FileSystem Store *StoreProvider }
Runtime is the Wails Runtime Interface, given to a user who has defined the WailsInit method
func NewRuntime ¶
func NewRuntime(eventManager interfaces.EventManager, renderer interfaces.Renderer) *Runtime
NewRuntime creates a new Runtime struct
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is where we keep named data
func (*Store) Get ¶
func (s *Store) Get() interface{}
Get returns the value of the data that's kept in the current state / Store
type StoreProvider ¶
type StoreProvider struct {
// contains filtered or unexported fields
}
StoreProvider is a struct that creates Stores
func NewStoreProvider ¶
func NewStoreProvider(runtime *Runtime) *StoreProvider
NewStoreProvider creates new stores using the provided Runtime reference.
func (*StoreProvider) New ¶
func (p *StoreProvider) New(name string, defaultValue interface{}) *Store
New creates a new store
type Window ¶
type Window struct {
// contains filtered or unexported fields
}
Window exposes an interface for manipulating the window
func NewWindow ¶
func NewWindow(renderer interfaces.Renderer) *Window
NewWindow creates a new Window struct
func (*Window) SetMaxSize ¶
SetMaxSize sets the maximum size of a resizable window
func (*Window) SetMinSize ¶
SetMinSize sets the minimum size of a resizable window
func (*Window) UnFullscreen ¶
func (r *Window) UnFullscreen()
UnFullscreen attempts to restore the window to the size/position before fullscreen