Documentation
¶
Index ¶
- Constants
- Variables
- func Fatal(message string, args ...interface{})
- type ActivationPolicy
- type App
- func (a *App) Clipboard() *Clipboard
- func (a *App) CurrentWindow() *WebviewWindow
- func (a *App) ErrorDialog() *MessageDialog
- func (a *App) GetPID() int
- func (a *App) GetPrimaryScreen() (*Screen, error)
- func (a *App) GetScreens() ([]*Screen, error)
- func (a *App) GetWindowByName(name string) *WebviewWindow
- func (a *App) Hide()
- func (a *App) InfoDialog() *MessageDialog
- func (a *App) Log(message *logger.Message)
- func (a *App) NewMenu() *Menu
- func (a *App) NewSystemTray() *SystemTray
- func (a *App) NewWebviewWindow() *WebviewWindow
- func (a *App) NewWebviewWindowWithOptions(windowOptions *WebviewWindowOptions) *WebviewWindow
- func (a *App) On(eventType events.ApplicationEventType, callback func())
- func (a *App) OnWindowCreation(callback func(window *WebviewWindow))
- func (a *App) OpenDirectoryDialog() *MessageDialog
- func (a *App) OpenFileDialog() *OpenFileDialog
- func (a *App) OpenFileDialogWithOptions(options *OpenFileDialogOptions) *OpenFileDialog
- func (a *App) QuestionDialog() *MessageDialog
- func (a *App) Quit()
- func (a *App) RegisterContextMenu(name string, menu *Menu)
- func (a *App) Run() error
- func (a *App) SaveFileDialog() *SaveFileDialog
- func (a *App) SaveFileDialogWithOptions(s *SaveFileDialogOptions) *SaveFileDialog
- func (a *App) SetMenu(menu *Menu)
- func (a *App) Show()
- func (a *App) ShowAboutDialog()
- func (a *App) WarningDialog() *MessageDialog
- type Args
- type AssetOptions
- type Bindings
- type BoundMethod
- type Button
- type CallOptions
- type Clipboard
- type Context
- type ContextMenuData
- type DialogType
- type EventProcessor
- func (e *EventProcessor) Emit(thisEvent *WailsEvent)
- func (e *EventProcessor) Off(eventName string)
- func (e *EventProcessor) OffAll()
- func (e *EventProcessor) On(eventName string, callback func(event *WailsEvent)) func()
- func (e *EventProcessor) OnMultiple(eventName string, callback func(event *WailsEvent), counter int) func()
- func (e *EventProcessor) Once(eventName string, callback func(event *WailsEvent)) func()
- type FileFilter
- type IconPosition
- type MacAppearanceType
- type MacBackdrop
- type MacOptions
- type MacTitleBar
- type MacToolbarStyle
- type MacWindow
- type Menu
- func (m *Menu) Add(label string) *MenuItem
- func (m *Menu) AddCheckbox(label string, enabled bool) *MenuItem
- func (m *Menu) AddRadio(label string, enabled bool) *MenuItem
- func (m *Menu) AddRole(role Role) *Menu
- func (m *Menu) AddSeparator()
- func (m *Menu) AddSubmenu(s string) *Menu
- func (m *Menu) SetLabel(label string)
- func (m *Menu) Update()
- type MenuItem
- func (m *MenuItem) Checked() bool
- func (m *MenuItem) Enabled() bool
- func (m *MenuItem) Label() string
- func (m *MenuItem) OnClick(f func(*Context)) *MenuItem
- func (m *MenuItem) SetAccelerator(shortcut string) *MenuItem
- func (m *MenuItem) SetChecked(checked bool) *MenuItem
- func (m *MenuItem) SetEnabled(enabled bool) *MenuItem
- func (m *MenuItem) SetLabel(s string) *MenuItem
- func (m *MenuItem) SetTooltip(s string) *MenuItem
- func (m *MenuItem) Tooltip() string
- type MessageDialog
- func (d *MessageDialog) AddButton(s string) *Button
- func (d *MessageDialog) AddButtons(buttons []*Button) *MessageDialog
- func (d *MessageDialog) SetCancelButton(button *Button) *MessageDialog
- func (d *MessageDialog) SetDefaultButton(button *Button) *MessageDialog
- func (d *MessageDialog) SetIcon(icon []byte) *MessageDialog
- func (d *MessageDialog) SetMessage(message string) *MessageDialog
- func (d *MessageDialog) SetTitle(title string) *MessageDialog
- func (d *MessageDialog) Show()
- type MessageDialogOptions
- type MessageProcessor
- type Middleware
- type OpenFileDialog
- func (d *OpenFileDialog) AddFilter(displayName, pattern string) *OpenFileDialog
- func (d *OpenFileDialog) AllowsOtherFileTypes(allowsOtherFileTypes bool) *OpenFileDialog
- func (d *OpenFileDialog) AttachToWindow(window *WebviewWindow) *OpenFileDialog
- func (d *OpenFileDialog) CanChooseDirectories(canChooseDirectories bool) *OpenFileDialog
- func (d *OpenFileDialog) CanChooseFiles(canChooseFiles bool) *OpenFileDialog
- func (d *OpenFileDialog) CanCreateDirectories(canCreateDirectories bool) *OpenFileDialog
- func (d *OpenFileDialog) CanSelectHiddenExtension(canSelectHiddenExtension bool) *OpenFileDialog
- func (d *OpenFileDialog) HideExtension(hideExtension bool) *OpenFileDialog
- func (d *OpenFileDialog) PromptForMultipleSelection() ([]string, error)
- func (d *OpenFileDialog) PromptForSingleSelection() (string, error)
- func (d *OpenFileDialog) ResolvesAliases(resolvesAliases bool) *OpenFileDialog
- func (d *OpenFileDialog) SetButtonText(text string) *OpenFileDialog
- func (d *OpenFileDialog) SetDirectory(directory string) *OpenFileDialog
- func (d *OpenFileDialog) SetMessage(message string) *OpenFileDialog
- func (d *OpenFileDialog) SetOptions(options *OpenFileDialogOptions)
- func (d *OpenFileDialog) SetTitle(title string) *OpenFileDialog
- func (d *OpenFileDialog) ShowHiddenFiles(showHiddenFiles bool) *OpenFileDialog
- func (d *OpenFileDialog) TreatsFilePackagesAsDirectories(treatsFilePackagesAsDirectories bool) *OpenFileDialog
- type OpenFileDialogOptions
- type Options
- type Parameter
- type Plugin
- type PluginCallOptions
- type PluginManager
- type QueryParams
- func (qp QueryParams) Args() (*Args, error)
- func (qp QueryParams) Bool(key string) *bool
- func (qp QueryParams) Float64(key string) *float64
- func (qp QueryParams) Int(key string) *int
- func (qp QueryParams) String(key string) *string
- func (qp QueryParams) ToStruct(str any) error
- func (qp QueryParams) UInt(key string) *uint
- func (qp QueryParams) UInt8(key string) *uint8
- type RGBA
- type Rect
- type Role
- type SaveFileDialog
- func (d *SaveFileDialog) AllowsOtherFileTypes(allowOtherFileTypes bool) *SaveFileDialog
- func (d *SaveFileDialog) AttachToWindow(window *WebviewWindow) *SaveFileDialog
- func (d *SaveFileDialog) CanCreateDirectories(canCreateDirectories bool) *SaveFileDialog
- func (d *SaveFileDialog) CanSelectHiddenExtension(canSelectHiddenExtension bool) *SaveFileDialog
- func (d *SaveFileDialog) HideExtension(hideExtension bool) *SaveFileDialog
- func (d *SaveFileDialog) PromptForSingleSelection() (string, error)
- func (d *SaveFileDialog) SetButtonText(text string) *SaveFileDialog
- func (d *SaveFileDialog) SetDirectory(directory string) *SaveFileDialog
- func (d *SaveFileDialog) SetFilename(filename string) *SaveFileDialog
- func (d *SaveFileDialog) SetMessage(message string) *SaveFileDialog
- func (d *SaveFileDialog) SetOptions(options *SaveFileDialogOptions)
- func (d *SaveFileDialog) ShowHiddenFiles(showHiddenFiles bool) *SaveFileDialog
- func (d *SaveFileDialog) TreatsFilePackagesAsDirectories(treatsFilePackagesAsDirectories bool) *SaveFileDialog
- type SaveFileDialogOptions
- type Screen
- type Size
- type SystemTray
- func (s *SystemTray) Destroy()
- func (s *SystemTray) Label() string
- func (s *SystemTray) Run()
- func (s *SystemTray) SetIcon(icon []byte) *SystemTray
- func (s *SystemTray) SetIconPosition(iconPosition int) *SystemTray
- func (s *SystemTray) SetLabel(label string)
- func (s *SystemTray) SetMenu(menu *Menu) *SystemTray
- func (s *SystemTray) SetTemplateIcon(icon []byte) *SystemTray
- type WailsEvent
- type WebviewWindow
- func (w *WebviewWindow) Center()
- func (w *WebviewWindow) Close()
- func (w *WebviewWindow) Destroy()
- func (w *WebviewWindow) ExecJS(js string)
- func (w *WebviewWindow) ForceReload()
- func (w *WebviewWindow) Fullscreen() *WebviewWindow
- func (w *WebviewWindow) GetScreen() (*Screen, error)
- func (w *WebviewWindow) GetZoom() float64
- func (w *WebviewWindow) Height() int
- func (w *WebviewWindow) Hide() *WebviewWindow
- func (w *WebviewWindow) IsFullscreen() bool
- func (w *WebviewWindow) IsMaximised() bool
- func (w *WebviewWindow) IsMinimised() bool
- func (w *WebviewWindow) Maximise() *WebviewWindow
- func (w *WebviewWindow) Minimise() *WebviewWindow
- func (w *WebviewWindow) Minimize()
- func (w *WebviewWindow) Name() string
- func (w *WebviewWindow) On(eventType events.WindowEventType, callback func(ctx *WindowEventContext))
- func (w *WebviewWindow) Position() (int, int)
- func (w *WebviewWindow) RegisterContextMenu(name string, menu *Menu)
- func (w *WebviewWindow) Reload()
- func (w *WebviewWindow) Resizable() bool
- func (w *WebviewWindow) Restore()
- func (w *WebviewWindow) SetAlwaysOnTop(b bool) *WebviewWindow
- func (w *WebviewWindow) SetBackgroundColour(colour *RGBA) *WebviewWindow
- func (w *WebviewWindow) SetFrameless(frameless bool) *WebviewWindow
- func (w *WebviewWindow) SetFullscreenButtonEnabled(enabled bool) *WebviewWindow
- func (w *WebviewWindow) SetHTML(html string) *WebviewWindow
- func (w *WebviewWindow) SetMaxSize(maxWidth, maxHeight int) *WebviewWindow
- func (w *WebviewWindow) SetMinSize(minWidth, minHeight int) *WebviewWindow
- func (w *WebviewWindow) SetPosition(x, y int) *WebviewWindow
- func (w *WebviewWindow) SetResizable(b bool) *WebviewWindow
- func (w *WebviewWindow) SetSize(width, height int) *WebviewWindow
- func (w *WebviewWindow) SetTitle(title string) *WebviewWindow
- func (w *WebviewWindow) SetURL(s string) *WebviewWindow
- func (w *WebviewWindow) SetZoom(magnification float64) *WebviewWindow
- func (w *WebviewWindow) Show() *WebviewWindow
- func (w *WebviewWindow) Size() (width int, height int)
- func (w *WebviewWindow) ToggleDevTools()
- func (w *WebviewWindow) ToggleFullscreen()
- func (w *WebviewWindow) UnFullscreen()
- func (w *WebviewWindow) UnMaximise()
- func (w *WebviewWindow) UnMinimise()
- func (w *WebviewWindow) Width() int
- func (w *WebviewWindow) Zoom()
- func (w *WebviewWindow) ZoomIn()
- func (w *WebviewWindow) ZoomOut()
- func (w *WebviewWindow) ZoomReset() *WebviewWindow
- type WebviewWindowOptions
- type WindowEvent
- type WindowEventContext
- type WindowState
Constants ¶
const ( // CmdOrCtrlKey represents Command on Mac and Control on other platforms CmdOrCtrlKey modifier = 0 << iota // OptionOrAltKey represents Option on Mac and Alt on other platforms OptionOrAltKey modifier = 1 << iota // ShiftKey represents the shift key on all systems ShiftKey modifier = 2 << iota // SuperKey represents Command on Mac and the Windows key on the other platforms SuperKey modifier = 3 << iota // ControlKey represents the control key on all systems ControlKey modifier = 4 << iota )
const ( NSImageNone = iota NSImageOnly NSImageLeft NSImageRight NSImageBelow NSImageAbove NSImageOverlaps NSImageLeading NSImageTrailing )
Variables ¶
var DefaultApplicationIcon = []byte{} /* 923 elements not displayed */
var DefaultMacTemplateIcon = []byte{} /* 760 elements not displayed */
var MacTitleBarDefault = MacTitleBar{ AppearsTransparent: false, Hide: false, HideTitle: false, FullSizeContent: false, UseToolbar: false, HideToolbarSeparator: false, }
MacTitleBarDefault results in the default Mac MacTitleBar
var MacTitleBarHidden = MacTitleBar{ AppearsTransparent: true, Hide: false, HideTitle: true, FullSizeContent: true, UseToolbar: false, HideToolbarSeparator: false, }
MacTitleBarHidden results in a hidden title bar and a full size content window, yet the title bar still has the standard window controls (“traffic lights”) in the top left.
var MacTitleBarHiddenInset = MacTitleBar{ AppearsTransparent: true, Hide: false, HideTitle: true, FullSizeContent: true, UseToolbar: true, HideToolbarSeparator: true, }
MacTitleBarHiddenInset results in a hidden title bar with an alternative look where the traffic light buttons are slightly more inset from the window edge.
var MacTitleBarHiddenInsetUnified = MacTitleBar{ AppearsTransparent: true, Hide: false, HideTitle: true, FullSizeContent: true, UseToolbar: true, HideToolbarSeparator: true, ToolbarStyle: MacToolbarStyleUnified, }
MacTitleBarHiddenInsetUnified results in a hidden title bar with an alternative look where the traffic light buttons are even more inset from the window edge.
var WailsLogoBlack = []byte{} /* 5109 elements not displayed */
var WailsLogoBlackTransparent = []byte{} /* 4526 elements not displayed */
var WailsLogoWhite = []byte{} /* 5233 elements not displayed */
var WailsLogoWhiteTransparent = []byte{} /* 4454 elements not displayed */
var WebviewWindowDefaults = &WebviewWindowOptions{
Title: "",
Width: 800,
Height: 600,
URL: "",
}
Functions ¶
Types ¶
type ActivationPolicy ¶
type ActivationPolicy int
const ( ActivationPolicyRegular ActivationPolicy = iota // ActivationPolicyAccessory is used for applications that do not have a main window, // such as system tray applications or background applications. ActivationPolicyAccessory ActivationPolicyProhibited )
type App ¶
type App struct { // The main application menu ApplicationMenu *Menu Events *EventProcessor // contains filtered or unexported fields }
func (*App) CurrentWindow ¶
func (a *App) CurrentWindow() *WebviewWindow
func (*App) ErrorDialog ¶
func (a *App) ErrorDialog() *MessageDialog
func (*App) GetPrimaryScreen ¶
func (*App) GetScreens ¶
func (*App) GetWindowByName ¶
func (a *App) GetWindowByName(name string) *WebviewWindow
func (*App) InfoDialog ¶
func (a *App) InfoDialog() *MessageDialog
func (*App) NewSystemTray ¶
func (a *App) NewSystemTray() *SystemTray
func (*App) NewWebviewWindow ¶
func (a *App) NewWebviewWindow() *WebviewWindow
func (*App) NewWebviewWindowWithOptions ¶
func (a *App) NewWebviewWindowWithOptions(windowOptions *WebviewWindowOptions) *WebviewWindow
func (*App) On ¶
func (a *App) On(eventType events.ApplicationEventType, callback func())
func (*App) OnWindowCreation ¶
func (a *App) OnWindowCreation(callback func(window *WebviewWindow))
func (*App) OpenDirectoryDialog ¶
func (a *App) OpenDirectoryDialog() *MessageDialog
func (*App) OpenFileDialog ¶
func (a *App) OpenFileDialog() *OpenFileDialog
func (*App) OpenFileDialogWithOptions ¶
func (a *App) OpenFileDialogWithOptions(options *OpenFileDialogOptions) *OpenFileDialog
func (*App) QuestionDialog ¶
func (a *App) QuestionDialog() *MessageDialog
func (*App) RegisterContextMenu ¶
func (*App) SaveFileDialog ¶
func (a *App) SaveFileDialog() *SaveFileDialog
func (*App) SaveFileDialogWithOptions ¶
func (a *App) SaveFileDialogWithOptions(s *SaveFileDialogOptions) *SaveFileDialog
func (*App) ShowAboutDialog ¶
func (a *App) ShowAboutDialog()
func (*App) WarningDialog ¶
func (a *App) WarningDialog() *MessageDialog
type AssetOptions ¶
type AssetOptions struct { // FS defines the static assets to be used. A GET request is first tried to be served from this FS. If the FS returns // `os.ErrNotExist` for that file, the request handling will fallback to the Handler and tries to serve the GET // request from it. // // If set to nil, all GET requests will be forwarded to Handler. FS fs.FS // Handler will be called for every GET request that can't be served from FS, due to `os.ErrNotExist`. Furthermore all // non GET requests will always be served from this Handler. // // If not defined, the result is the following in cases where the Handler would have been called: // GET request: `http.StatusNotFound` // Other request: `http.StatusMethodNotAllowed` Handler http.Handler // Middleware is a HTTP Middleware which allows to hook into the AssetServer request chain. It allows to skip the default // request handler dynamically, e.g. implement specialized Routing etc. // The Middleware is called to build a new `http.Handler` used by the AssetSever and it also receives the default // handler used by the AssetServer as an argument. // // If not defined, the default AssetServer request chain is executed. // // Multiple Middlewares can be chained together with: // ChainMiddleware(middleware ...Middleware) Middleware Middleware Middleware }
AssetOptions defines the configuration of the AssetServer.
type Bindings ¶
type Bindings struct {
// contains filtered or unexported fields
}
func NewBindings ¶
func (*Bindings) Get ¶
func (b *Bindings) Get(options *CallOptions) *BoundMethod
type BoundMethod ¶
type BoundMethod struct { Name string `json:"name"` Inputs []*Parameter `json:"inputs,omitempty"` Outputs []*Parameter `json:"outputs,omitempty"` Comments string `json:"comments,omitempty"` Method reflect.Value `json:"-"` PackageName string StructName string PackagePath string }
BoundMethod defines all the data related to a Go method that is bound to the Wails application
func (*BoundMethod) Call ¶
func (b *BoundMethod) Call(args []interface{}) (interface{}, error)
Call will attempt to call this bound method with the given args
type Button ¶
type CallOptions ¶
type Context ¶
type Context struct {
// contains filtered or unexported fields
}
func (*Context) ClickedMenuItem ¶
func (*Context) ContextMenuData ¶
type ContextMenuData ¶
type DialogType ¶
type DialogType int
const ( InfoDialog DialogType = iota QuestionDialog WarningDialog ErrorDialog OpenDirectoryDialog )
type EventProcessor ¶
type EventProcessor struct {
// contains filtered or unexported fields
}
EventProcessor handles custom events
func NewWailsEventProcessor ¶
func NewWailsEventProcessor(dispatchEventToWindows func(*WailsEvent)) *EventProcessor
func (*EventProcessor) Emit ¶
func (e *EventProcessor) Emit(thisEvent *WailsEvent)
Emit sends an event to all listeners
func (*EventProcessor) Off ¶
func (e *EventProcessor) Off(eventName string)
func (*EventProcessor) OffAll ¶
func (e *EventProcessor) OffAll()
func (*EventProcessor) On ¶
func (e *EventProcessor) On(eventName string, callback func(event *WailsEvent)) func()
On is the equivalent of Javascript's `addEventListener`
func (*EventProcessor) OnMultiple ¶
func (e *EventProcessor) OnMultiple(eventName string, callback func(event *WailsEvent), counter int) func()
OnMultiple is the same as `On` but will unregister after `count` events
func (*EventProcessor) Once ¶
func (e *EventProcessor) Once(eventName string, callback func(event *WailsEvent)) func()
Once is the same as `On` but will unregister after the first event
type FileFilter ¶
type IconPosition ¶
type IconPosition int
type MacAppearanceType ¶
type MacAppearanceType string
MacAppearanceType is a type of Appearance for Cocoa windows
const ( // DefaultAppearance uses the default system value DefaultAppearance MacAppearanceType = "" // NSAppearanceNameAqua - The standard light system appearance. NSAppearanceNameAqua MacAppearanceType = "NSAppearanceNameAqua" // NSAppearanceNameDarkAqua - The standard dark system appearance. NSAppearanceNameDarkAqua MacAppearanceType = "NSAppearanceNameDarkAqua" // NSAppearanceNameVibrantLight - The light vibrant appearance NSAppearanceNameVibrantLight MacAppearanceType = "NSAppearanceNameVibrantLight" // NSAppearanceNameAccessibilityHighContrastAqua - A high-contrast version of the standard light system appearance. NSAppearanceNameAccessibilityHighContrastAqua MacAppearanceType = "NSAppearanceNameAccessibilityHighContrastAqua" // NSAppearanceNameAccessibilityHighContrastDarkAqua - A high-contrast version of the standard dark system appearance. NSAppearanceNameAccessibilityHighContrastDarkAqua MacAppearanceType = "NSAppearanceNameAccessibilityHighContrastDarkAqua" // NSAppearanceNameAccessibilityHighContrastVibrantLight - A high-contrast version of the light vibrant appearance. NSAppearanceNameAccessibilityHighContrastVibrantLight MacAppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantLight" // NSAppearanceNameAccessibilityHighContrastVibrantDark - A high-contrast version of the dark vibrant appearance. NSAppearanceNameAccessibilityHighContrastVibrantDark MacAppearanceType = "NSAppearanceNameAccessibilityHighContrastVibrantDark" )
type MacBackdrop ¶
type MacBackdrop int
const ( MacBackdropNormal MacBackdrop = iota MacBackdropTransparent MacBackdropTranslucent )
type MacOptions ¶
type MacOptions struct { // ActivationPolicy is the activation policy for the application. Defaults to // applicationActivationPolicyRegular. ActivationPolicy ActivationPolicy // If set to true, the application will terminate when the last window is closed. ApplicationShouldTerminateAfterLastWindowClosed bool }
type MacTitleBar ¶
type MacTitleBar struct { AppearsTransparent bool Hide bool HideTitle bool FullSizeContent bool UseToolbar bool HideToolbarSeparator bool ToolbarStyle MacToolbarStyle }
MacTitleBar contains options for the Mac titlebar
type MacToolbarStyle ¶
type MacToolbarStyle int
const ( // MacToolbarStyleAutomatic - The default value. The style will be determined by the window's given configuration MacToolbarStyleAutomatic MacToolbarStyle = iota // MacToolbarStyleExpanded - The toolbar will appear below the window title MacToolbarStyleExpanded // MacToolbarStylePreference - The toolbar will appear below the window title and the items in the toolbar will attempt to have equal widths when possible MacToolbarStylePreference // MacToolbarStyleUnified - The window title will appear inline with the toolbar when visible MacToolbarStyleUnified // MacToolbarStyleUnifiedCompact - Same as MacToolbarStyleUnified, but with reduced margins in the toolbar allowing more focus to be on the contents of the window MacToolbarStyleUnifiedCompact )
type MacWindow ¶
type MacWindow struct { Backdrop MacBackdrop TitleBar MacTitleBar Appearance MacAppearanceType InvisibleTitleBarHeight int }
MacWindow contains macOS specific options
type Menu ¶
type Menu struct {
// contains filtered or unexported fields
}
func (*Menu) AddSeparator ¶
func (m *Menu) AddSeparator()
func (*Menu) AddSubmenu ¶
type MenuItem ¶
type MenuItem struct {
// contains filtered or unexported fields
}
func (*MenuItem) SetAccelerator ¶
func (*MenuItem) SetChecked ¶
func (*MenuItem) SetEnabled ¶
func (*MenuItem) SetTooltip ¶
type MessageDialog ¶
type MessageDialog struct { MessageDialogOptions // contains filtered or unexported fields }
func (*MessageDialog) AddButton ¶
func (d *MessageDialog) AddButton(s string) *Button
func (*MessageDialog) AddButtons ¶
func (d *MessageDialog) AddButtons(buttons []*Button) *MessageDialog
func (*MessageDialog) SetCancelButton ¶
func (d *MessageDialog) SetCancelButton(button *Button) *MessageDialog
func (*MessageDialog) SetDefaultButton ¶
func (d *MessageDialog) SetDefaultButton(button *Button) *MessageDialog
func (*MessageDialog) SetIcon ¶
func (d *MessageDialog) SetIcon(icon []byte) *MessageDialog
func (*MessageDialog) SetMessage ¶
func (d *MessageDialog) SetMessage(message string) *MessageDialog
func (*MessageDialog) SetTitle ¶
func (d *MessageDialog) SetTitle(title string) *MessageDialog
func (*MessageDialog) Show ¶
func (d *MessageDialog) Show()
type MessageDialogOptions ¶
type MessageDialogOptions struct { DialogType DialogType Title string Message string Buttons []*Button Icon []byte }
type MessageProcessor ¶
type MessageProcessor struct {
// contains filtered or unexported fields
}
func NewMessageProcessor ¶
func NewMessageProcessor() *MessageProcessor
func (*MessageProcessor) Error ¶
func (m *MessageProcessor) Error(message string, args ...any)
func (*MessageProcessor) HandleRuntimeCall ¶
func (m *MessageProcessor) HandleRuntimeCall(rw http.ResponseWriter, r *http.Request)
func (*MessageProcessor) Info ¶
func (m *MessageProcessor) Info(message string, args ...any)
type Middleware ¶
Middleware defines a HTTP middleware that can be applied to the AssetServer. The handler passed as next is the next handler in the chain. One can decide to call the next handler or implement a specialized handling.
func ChainMiddleware ¶
func ChainMiddleware(middleware ...Middleware) Middleware
ChainMiddleware allows chaining multiple middlewares to one middleware.
type OpenFileDialog ¶
type OpenFileDialog struct {
// contains filtered or unexported fields
}
func (*OpenFileDialog) AddFilter ¶
func (d *OpenFileDialog) AddFilter(displayName, pattern string) *OpenFileDialog
AddFilter adds a filter to the dialog. The filter is a display name and a semicolon separated list of extensions. EG: AddFilter("Image Files", "*.jpg;*.png")
func (*OpenFileDialog) AllowsOtherFileTypes ¶
func (d *OpenFileDialog) AllowsOtherFileTypes(allowsOtherFileTypes bool) *OpenFileDialog
func (*OpenFileDialog) AttachToWindow ¶
func (d *OpenFileDialog) AttachToWindow(window *WebviewWindow) *OpenFileDialog
func (*OpenFileDialog) CanChooseDirectories ¶
func (d *OpenFileDialog) CanChooseDirectories(canChooseDirectories bool) *OpenFileDialog
func (*OpenFileDialog) CanChooseFiles ¶
func (d *OpenFileDialog) CanChooseFiles(canChooseFiles bool) *OpenFileDialog
func (*OpenFileDialog) CanCreateDirectories ¶
func (d *OpenFileDialog) CanCreateDirectories(canCreateDirectories bool) *OpenFileDialog
func (*OpenFileDialog) CanSelectHiddenExtension ¶
func (d *OpenFileDialog) CanSelectHiddenExtension(canSelectHiddenExtension bool) *OpenFileDialog
func (*OpenFileDialog) HideExtension ¶
func (d *OpenFileDialog) HideExtension(hideExtension bool) *OpenFileDialog
func (*OpenFileDialog) PromptForMultipleSelection ¶
func (d *OpenFileDialog) PromptForMultipleSelection() ([]string, error)
func (*OpenFileDialog) PromptForSingleSelection ¶
func (d *OpenFileDialog) PromptForSingleSelection() (string, error)
func (*OpenFileDialog) ResolvesAliases ¶
func (d *OpenFileDialog) ResolvesAliases(resolvesAliases bool) *OpenFileDialog
func (*OpenFileDialog) SetButtonText ¶
func (d *OpenFileDialog) SetButtonText(text string) *OpenFileDialog
func (*OpenFileDialog) SetDirectory ¶
func (d *OpenFileDialog) SetDirectory(directory string) *OpenFileDialog
func (*OpenFileDialog) SetMessage ¶
func (d *OpenFileDialog) SetMessage(message string) *OpenFileDialog
func (*OpenFileDialog) SetOptions ¶
func (d *OpenFileDialog) SetOptions(options *OpenFileDialogOptions)
func (*OpenFileDialog) SetTitle ¶
func (d *OpenFileDialog) SetTitle(title string) *OpenFileDialog
func (*OpenFileDialog) ShowHiddenFiles ¶
func (d *OpenFileDialog) ShowHiddenFiles(showHiddenFiles bool) *OpenFileDialog
func (*OpenFileDialog) TreatsFilePackagesAsDirectories ¶
func (d *OpenFileDialog) TreatsFilePackagesAsDirectories(treatsFilePackagesAsDirectories bool) *OpenFileDialog
type OpenFileDialogOptions ¶
type OpenFileDialogOptions struct { CanChooseDirectories bool CanChooseFiles bool CanCreateDirectories bool ShowHiddenFiles bool ResolvesAliases bool AllowsMultipleSelection bool HideExtension bool CanSelectHiddenExtension bool TreatsFilePackagesAsDirectories bool AllowsOtherFileTypes bool Filters []FileFilter Title string Message string ButtonText string Directory string }
type Parameter ¶
type Parameter struct { Name string `json:"name,omitempty"` TypeName string `json:"type"` ReflectType reflect.Type }
Parameter defines a Go method parameter
type PluginCallOptions ¶
type PluginManager ¶
type PluginManager struct {
// contains filtered or unexported fields
}
func NewPluginManager ¶
func NewPluginManager(plugins map[string]Plugin, assetServer *assetserver.AssetServer) *PluginManager
func (*PluginManager) Init ¶
func (p *PluginManager) Init() error
func (*PluginManager) Shutdown ¶
func (p *PluginManager) Shutdown()
type QueryParams ¶
func (QueryParams) Args ¶
func (qp QueryParams) Args() (*Args, error)
func (QueryParams) Bool ¶
func (qp QueryParams) Bool(key string) *bool
func (QueryParams) Float64 ¶
func (qp QueryParams) Float64(key string) *float64
func (QueryParams) Int ¶
func (qp QueryParams) Int(key string) *int
func (QueryParams) String ¶
func (qp QueryParams) String(key string) *string
func (QueryParams) ToStruct ¶
func (qp QueryParams) ToStruct(str any) error
func (QueryParams) UInt ¶
func (qp QueryParams) UInt(key string) *uint
func (QueryParams) UInt8 ¶
func (qp QueryParams) UInt8(key string) *uint8
type Role ¶
type Role uint
Role is a type to identify menu roles
const ( NoRole Role = iota AppMenu Role = iota EditMenu Role = iota ViewMenu Role = iota WindowMenu Role = iota ServicesMenu Role = iota HelpMenu Role = iota Hide Role = iota HideOthers Role = iota UnHide Role = iota About Role = iota Undo Role = iota Redo Role = iota Cut Role = iota Copy Role = iota Paste Role = iota PasteAndMatchStyle Role = iota SelectAll Role = iota Delete Role = iota SpeechMenu Role = iota Quit Role = iota FileMenu Role = iota Close Role = iota Reload Role = iota ForceReload Role = iota ToggleDevTools Role = iota ResetZoom Role = iota ZoomIn Role = iota ZoomOut Role = iota ToggleFullscreen Role = iota Minimize Role = iota Zoom Role = iota )
These constants need to be kept in sync with `v2/internal/frontend/desktop/darwin/Role.h`
type SaveFileDialog ¶
type SaveFileDialog struct {
// contains filtered or unexported fields
}
func (*SaveFileDialog) AllowsOtherFileTypes ¶
func (d *SaveFileDialog) AllowsOtherFileTypes(allowOtherFileTypes bool) *SaveFileDialog
func (*SaveFileDialog) AttachToWindow ¶
func (d *SaveFileDialog) AttachToWindow(window *WebviewWindow) *SaveFileDialog
func (*SaveFileDialog) CanCreateDirectories ¶
func (d *SaveFileDialog) CanCreateDirectories(canCreateDirectories bool) *SaveFileDialog
func (*SaveFileDialog) CanSelectHiddenExtension ¶
func (d *SaveFileDialog) CanSelectHiddenExtension(canSelectHiddenExtension bool) *SaveFileDialog
func (*SaveFileDialog) HideExtension ¶
func (d *SaveFileDialog) HideExtension(hideExtension bool) *SaveFileDialog
func (*SaveFileDialog) PromptForSingleSelection ¶
func (d *SaveFileDialog) PromptForSingleSelection() (string, error)
func (*SaveFileDialog) SetButtonText ¶
func (d *SaveFileDialog) SetButtonText(text string) *SaveFileDialog
func (*SaveFileDialog) SetDirectory ¶
func (d *SaveFileDialog) SetDirectory(directory string) *SaveFileDialog
func (*SaveFileDialog) SetFilename ¶
func (d *SaveFileDialog) SetFilename(filename string) *SaveFileDialog
func (*SaveFileDialog) SetMessage ¶
func (d *SaveFileDialog) SetMessage(message string) *SaveFileDialog
func (*SaveFileDialog) SetOptions ¶
func (d *SaveFileDialog) SetOptions(options *SaveFileDialogOptions)
func (*SaveFileDialog) ShowHiddenFiles ¶
func (d *SaveFileDialog) ShowHiddenFiles(showHiddenFiles bool) *SaveFileDialog
func (*SaveFileDialog) TreatsFilePackagesAsDirectories ¶
func (d *SaveFileDialog) TreatsFilePackagesAsDirectories(treatsFilePackagesAsDirectories bool) *SaveFileDialog
type SaveFileDialogOptions ¶
type Screen ¶
type Screen struct { ID string // A unique identifier for the display Name string // The name of the display Scale float32 // The scale factor of the display X int // The x-coordinate of the top-left corner of the rectangle Y int // The y-coordinate of the top-left corner of the rectangle Size Size // The size of the display Bounds Rect // The bounds of the display WorkArea Rect // The work area of the display IsPrimary bool // Whether this is the primary display Rotation float32 // The rotation of the display }
type SystemTray ¶
type SystemTray struct {
// contains filtered or unexported fields
}
func NewSystemTray ¶
func NewSystemTray(id uint) *SystemTray
func (*SystemTray) Destroy ¶
func (s *SystemTray) Destroy()
func (*SystemTray) Label ¶
func (s *SystemTray) Label() string
func (*SystemTray) Run ¶
func (s *SystemTray) Run()
func (*SystemTray) SetIcon ¶
func (s *SystemTray) SetIcon(icon []byte) *SystemTray
func (*SystemTray) SetIconPosition ¶
func (s *SystemTray) SetIconPosition(iconPosition int) *SystemTray
func (*SystemTray) SetLabel ¶
func (s *SystemTray) SetLabel(label string)
func (*SystemTray) SetMenu ¶
func (s *SystemTray) SetMenu(menu *Menu) *SystemTray
func (*SystemTray) SetTemplateIcon ¶
func (s *SystemTray) SetTemplateIcon(icon []byte) *SystemTray
type WailsEvent ¶
type WailsEvent struct { Name string `json:"name"` Data any `json:"data"` Sender string `json:"sender"` }
func (WailsEvent) ToJSON ¶
func (e WailsEvent) ToJSON() string
type WebviewWindow ¶
type WebviewWindow struct {
// contains filtered or unexported fields
}
func NewWindow ¶
func NewWindow(options *WebviewWindowOptions) *WebviewWindow
func (*WebviewWindow) Center ¶
func (w *WebviewWindow) Center()
func (*WebviewWindow) Close ¶
func (w *WebviewWindow) Close()
func (*WebviewWindow) Destroy ¶
func (w *WebviewWindow) Destroy()
func (*WebviewWindow) ExecJS ¶
func (w *WebviewWindow) ExecJS(js string)
func (*WebviewWindow) ForceReload ¶
func (w *WebviewWindow) ForceReload()
func (*WebviewWindow) Fullscreen ¶
func (w *WebviewWindow) Fullscreen() *WebviewWindow
func (*WebviewWindow) GetScreen ¶
func (w *WebviewWindow) GetScreen() (*Screen, error)
func (*WebviewWindow) GetZoom ¶
func (w *WebviewWindow) GetZoom() float64
func (*WebviewWindow) Height ¶
func (w *WebviewWindow) Height() int
func (*WebviewWindow) Hide ¶
func (w *WebviewWindow) Hide() *WebviewWindow
func (*WebviewWindow) IsFullscreen ¶
func (w *WebviewWindow) IsFullscreen() bool
IsFullscreen returns true if the window is fullscreen
func (*WebviewWindow) IsMaximised ¶
func (w *WebviewWindow) IsMaximised() bool
IsMaximised returns true if the window is maximised
func (*WebviewWindow) IsMinimised ¶
func (w *WebviewWindow) IsMinimised() bool
IsMinimised returns true if the window is minimised
func (*WebviewWindow) Maximise ¶
func (w *WebviewWindow) Maximise() *WebviewWindow
func (*WebviewWindow) Minimise ¶
func (w *WebviewWindow) Minimise() *WebviewWindow
func (*WebviewWindow) Minimize ¶
func (w *WebviewWindow) Minimize()
func (*WebviewWindow) Name ¶
func (w *WebviewWindow) Name() string
func (*WebviewWindow) On ¶
func (w *WebviewWindow) On(eventType events.WindowEventType, callback func(ctx *WindowEventContext))
func (*WebviewWindow) Position ¶
func (w *WebviewWindow) Position() (int, int)
func (*WebviewWindow) RegisterContextMenu ¶
func (w *WebviewWindow) RegisterContextMenu(name string, menu *Menu)
func (*WebviewWindow) Reload ¶
func (w *WebviewWindow) Reload()
func (*WebviewWindow) Resizable ¶
func (w *WebviewWindow) Resizable() bool
func (*WebviewWindow) Restore ¶
func (w *WebviewWindow) Restore()
func (*WebviewWindow) SetAlwaysOnTop ¶
func (w *WebviewWindow) SetAlwaysOnTop(b bool) *WebviewWindow
func (*WebviewWindow) SetBackgroundColour ¶
func (w *WebviewWindow) SetBackgroundColour(colour *RGBA) *WebviewWindow
func (*WebviewWindow) SetFrameless ¶
func (w *WebviewWindow) SetFrameless(frameless bool) *WebviewWindow
func (*WebviewWindow) SetFullscreenButtonEnabled ¶
func (w *WebviewWindow) SetFullscreenButtonEnabled(enabled bool) *WebviewWindow
func (*WebviewWindow) SetHTML ¶
func (w *WebviewWindow) SetHTML(html string) *WebviewWindow
func (*WebviewWindow) SetMaxSize ¶
func (w *WebviewWindow) SetMaxSize(maxWidth, maxHeight int) *WebviewWindow
func (*WebviewWindow) SetMinSize ¶
func (w *WebviewWindow) SetMinSize(minWidth, minHeight int) *WebviewWindow
func (*WebviewWindow) SetPosition ¶
func (w *WebviewWindow) SetPosition(x, y int) *WebviewWindow
func (*WebviewWindow) SetResizable ¶
func (w *WebviewWindow) SetResizable(b bool) *WebviewWindow
func (*WebviewWindow) SetSize ¶
func (w *WebviewWindow) SetSize(width, height int) *WebviewWindow
func (*WebviewWindow) SetTitle ¶
func (w *WebviewWindow) SetTitle(title string) *WebviewWindow
func (*WebviewWindow) SetURL ¶
func (w *WebviewWindow) SetURL(s string) *WebviewWindow
func (*WebviewWindow) SetZoom ¶
func (w *WebviewWindow) SetZoom(magnification float64) *WebviewWindow
func (*WebviewWindow) Show ¶
func (w *WebviewWindow) Show() *WebviewWindow
func (*WebviewWindow) Size ¶
func (w *WebviewWindow) Size() (width int, height int)
Size returns the size of the window
func (*WebviewWindow) ToggleDevTools ¶
func (w *WebviewWindow) ToggleDevTools()
func (*WebviewWindow) ToggleFullscreen ¶
func (w *WebviewWindow) ToggleFullscreen()
func (*WebviewWindow) UnFullscreen ¶
func (w *WebviewWindow) UnFullscreen()
func (*WebviewWindow) UnMaximise ¶
func (w *WebviewWindow) UnMaximise()
func (*WebviewWindow) UnMinimise ¶
func (w *WebviewWindow) UnMinimise()
func (*WebviewWindow) Width ¶
func (w *WebviewWindow) Width() int
func (*WebviewWindow) Zoom ¶
func (w *WebviewWindow) Zoom()
func (*WebviewWindow) ZoomIn ¶
func (w *WebviewWindow) ZoomIn()
func (*WebviewWindow) ZoomOut ¶
func (w *WebviewWindow) ZoomOut()
func (*WebviewWindow) ZoomReset ¶
func (w *WebviewWindow) ZoomReset() *WebviewWindow
type WebviewWindowOptions ¶
type WebviewWindowOptions struct { Name string Title string Width, Height int AlwaysOnTop bool URL string DisableResize bool Frameless bool MinWidth int MinHeight int MaxWidth int MaxHeight int StartState WindowState Mac MacWindow BackgroundColour *RGBA HTML string JS string CSS string X int Y int HideOnClose bool FullscreenButtonEnabled bool Hidden bool EnableFraudulentWebsiteWarnings bool Zoom float64 EnableDragAndDrop bool }
type WindowEvent ¶
type WindowEventContext ¶
type WindowEventContext struct {
// contains filtered or unexported fields
}
func (WindowEventContext) DroppedFiles ¶
func (c WindowEventContext) DroppedFiles() []string
type WindowState ¶
type WindowState int
const ( WindowStateNormal WindowState = iota WindowStateMinimised WindowStateMaximised WindowStateFullscreen )
Source Files
¶
- application.go
- bindings.go
- clipboard.go
- context.go
- context_window_event.go
- dialogs.go
- errors.go
- events.go
- icons.go
- keys.go
- mainthread.go
- menu.go
- menuitem.go
- messageprocessor.go
- messageprocessor_application.go
- messageprocessor_call.go
- messageprocessor_clipboard.go
- messageprocessor_contextmenu.go
- messageprocessor_dialog.go
- messageprocessor_events.go
- messageprocessor_log.go
- messageprocessor_params.go
- messageprocessor_screens.go
- messageprocessor_window.go
- options_application.go
- options_mac.go
- options_webview_window.go
- plugins.go
- roles.go
- screen.go
- systemtray.go
- webview_window.go