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 ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ContextMenus ¶
type ContextMenus interface { On(menuID string, callback func(*menu.MenuItem, string)) Update() GetByID(menuID string) *menu.MenuItem RemoveByID(id string) bool }
ContextMenus defines all ContextMenu related operations
type Dialog ¶
type Dialog interface { Open(dialogOptions *options.OpenDialog) []string Save(dialogOptions *options.SaveDialog) string Message(dialogOptions *options.MessageDialog) string }
Dialog defines all Dialog related operations
type Events ¶
type Events interface { On(eventName string, callback func(optionalData ...interface{})) Once(eventName string, callback func(optionalData ...interface{})) OnMultiple(eventName string, callback func(optionalData ...interface{}), maxCallbacks int) Emit(eventName string, optionalData ...interface{}) OnThemeChange(callback func(darkMode bool)) }
Events defines all events related operations
type Log ¶
type Log interface { Print(message string) Trace(message string) Debug(message string) Info(message string) Warning(message string) Error(message string) Fatal(message string) SetLogLevel(level logger.LogLevel) }
Log defines all Log related operations
type Menu ¶
type Menu interface { On(menuID string, callback func(*menu.MenuItem)) Update() GetByID(menuID string) *menu.MenuItem RemoveByID(id string) bool }
Menu defines all Menu related operations
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 { Browser Browser Events Events Window Window Dialog Dialog System System Menu Menu ContextMenu ContextMenus Tray Tray Store *StoreProvider Log Log // contains filtered or unexported fields }
Runtime is a means for the user to interact with the application at runtime
func New ¶
func New(serviceBus *servicebus.ServiceBus, menu *menu.Menu, trayMenu *menu.Tray, contextMenus *menu.ContextMenus) *Runtime
New creates a new runtime
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 (*StoreProvider) New ¶
func (p *StoreProvider) New(name string, defaultValue interface{}) *Store
New creates a new store