commit 398ed6bd3e7f5e2418cd5d219f94f3d3c8c1702f Author: <> Date: Mon May 13 20:40:14 2024 +0000 Deployed 9c4b412 with MkDocs version: 1.6.0 diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 00000000..e69de29b diff --git a/404.html b/404.html new file mode 100644 index 00000000..8b6fb05b --- /dev/null +++ b/404.html @@ -0,0 +1,865 @@ + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + +The application API assists in creating an application using the Wails +framework.
+API: New(appOptions Options) *App
New(appOptions Options) creates a new application using the given application
+options . It applies default values for unspecified options, merges them with
+the provided ones, initializes and returns an instance of the application.
In case of an error during initialization, the application is stopped with the +error message provided.
+It should be noted that if a global application instance already exists, that +instance will be returned instead of creating a new one.
+package main
+
+import "github.com/wailsapp/wails/v3/pkg/application"
+
+func main() {
+ app := application.New(application.Options{
+ Name: "WebviewWindow Demo",
+ // Other options
+ })
+
+ // Rest of application
+}
+Get() returns the global application instance. It's useful when you need to
+access the application from different parts of your code.
API: Capabilities() capabilities.Capabilities
Capabilities() retrieves a map of capabilities that the application currently
+has. Capabilities can be about different features the operating system provides,
+like webview features.
// Get the application capabilities
+ capabilities := app.Capabilities()
+ if capabilities.HasNativeDrag {
+ // Do something
+ }
+API: GetPID() int
GetPID() returns the Process ID of the application.
API: Run() error
Run() starts the execution of the application and its components.
app := application.New(application.Options{
+ //options
+ })
+ // Run the application
+ err := application.Run()
+ if err != nil {
+ // Handle error
+ }
+API: Quit()
Quit() quits the application by destroying windows and potentially other
+components.
API: IsDarkMode() bool
IsDarkMode() checks if the application is running in dark mode. It returns a
+boolean indicating whether dark mode is enabled.
API: Hide()
Hide() hides the application window.
API: Show()
Show() shows the application window.
API: NewWebviewWindow() *WebviewWindow
NewWebviewWindow() creates a new Webview window with default options, and
+returns it.
API:
+NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindow
NewWebviewWindowWithOptions() creates a new webview window with custom
+options. The newly created window is added to a map of windows managed by the
+application.
// Create a new webview window with custom options
+ window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
+ Name: "Main",
+ Title: "My Window",
+ Width: 800,
+ Height: 600,
+ })
+API: OnWindowCreation(callback func(window *WebviewWindow))
OnWindowCreation() registers a callback function to be called when a window is
+created.
// Register a callback to be called when a window is created
+ app.OnWindowCreation(func(window *WebviewWindow) {
+ // Do something
+ })
+API: GetWindowByName(name string) *WebviewWindow
GetWindowByName() fetches and returns a window with a specific name.
API: CurrentWindow() *WebviewWindow
CurrentWindow() fetches and returns a pointer to the currently active window
+in the application. If there is no window, it returns nil.
API: RegisterContextMenu(name string, menu *Menu)
RegisterContextMenu() registers a context menu with a given name. This menu
+can be used later in the application.
// Create a new menu
+ ctxmenu := app.NewMenu()
+
+ // Register the menu as a context menu
+ app.RegisterContextMenu("MyContextMenu", ctxmenu)
+API: SetMenu(menu *Menu)
SetMenu() sets the menu for the application. On Mac, this will be the global
+menu. For Windows and Linux, this will be the default menu for any new window
+created.
// Create a new menu
+ menu := app.NewMenu()
+
+ // Set the menu for the application
+ app.SetMenu(menu)
+API: ShowAboutDialog()
ShowAboutDialog() shows an "About" dialog box. It can show the application's
+name, description and icon.
API: InfoDialog()
InfoDialog() creates and returns a new instance of MessageDialog with an
+InfoDialogType. This dialog is typically used to display informational
+messages to the user.
API: QuestionDialog()
QuestionDialog() creates and returns a new instance of MessageDialog with a
+QuestionDialogType. This dialog is often used to ask a question to the user
+and expect a response.
API: WarningDialog()
WarningDialog() creates and returns a new instance of MessageDialog with a
+WarningDialogType. As the name suggests, this dialog is primarily used to
+display warning messages to the user.
API: ErrorDialog()
ErrorDialog() creates and returns a new instance of MessageDialog with an
+ErrorDialogType. This dialog is designed to be used when you need to display
+an error message to the user.
API: OpenFileDialog()
OpenFileDialog() creates and returns a new OpenFileDialogStruct. This dialog
+prompts the user to select one or more files from their file system.
API: SaveFileDialog()
SaveFileDialog() creates and returns a new SaveFileDialogStruct. This dialog
+prompts the user to choose a location on their file system where a file should
+be saved.
API: OpenDirectoryDialog()
OpenDirectoryDialog() creates and returns a new instance of MessageDialog
+with an OpenDirectoryDialogType. This dialog enables the user to choose a
+directory from their file system.
API:
+On(eventType events.ApplicationEventType, callback func(event *Event)) func()
On() registers an event listener for specific application events. The callback
+function provided will be triggered when the corresponding event occurs. The
+function returns a function that can be called to remove the listener.
API:
+RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()
RegisterHook() registers a callback to be run as a hook during specific
+events. These hooks are run before listeners attached with On(). The function
+returns a function that can be called to remove the hook.
API: GetPrimaryScreen() (*Screen, error)
GetPrimaryScreen() returns the primary screen of the system.
API: GetScreens() ([]*Screen, error)
GetScreens() returns information about all screens attached to the system.
This is a brief summary of the exported methods in the provided App struct. Do
+note that for more detailed functionality or considerations, refer to the actual
+Go code or further internal documentation.
package application
+
+import (
+ "io/fs"
+ "log/slog"
+ "net/http"
+
+ "github.com/wailsapp/wails/v3/internal/assetserver"
+)
+
+// Options contains the options for the application
+type Options struct {
+ // Name is the name of the application (used in the default about box)
+ Name string
+
+ // Description is the description of the application (used in the default about box)
+ Description string
+
+ // Icon is the icon of the application (used in the default about box)
+ Icon []byte
+
+ // Mac is the Mac specific configuration for Mac builds
+ Mac MacOptions
+
+ // Windows is the Windows specific configuration for Windows builds
+ Windows WindowsOptions
+
+ // Linux is the Linux specific configuration for Linux builds
+ Linux LinuxOptions
+
+ // Bind allows you to bind Go methods to the frontend.
+ Bind []any
+
+ // BindAliases allows you to specify alias IDs for your bound methods.
+ // Example: `BindAliases: map[uint32]uint32{1: 1411160069}` states that alias ID 1 maps to the Go method with ID 1411160069.
+ BindAliases map[uint32]uint32
+
+ // Logger i a slog.Logger instance used for logging Wails system messages (not application messages).
+ // If not defined, a default logger is used.
+ Logger *slog.Logger
+
+ // LogLevel defines the log level of the Wails system logger.
+ LogLevel slog.Level
+
+ // Assets are the application assets to be used.
+ Assets AssetOptions
+
+ // Plugins is a map of plugins used by the application
+ Plugins map[string]Plugin
+
+ // Flags are key value pairs that are available to the frontend.
+ // This is also used by Wails to provide information to the frontend.
+ Flags map[string]any
+
+ // PanicHandler is called when a panic occurs
+ PanicHandler func(any)
+
+ // DisableDefaultSignalHandler disables the default signal handler
+ DisableDefaultSignalHandler bool
+
+ // KeyBindings is a map of key bindings to functions
+ KeyBindings map[string]func(window *WebviewWindow)
+
+ // OnShutdown is called when the application is about to terminate.
+ // This is useful for cleanup tasks.
+ // The shutdown process blocks until this function returns
+ OnShutdown func()
+
+ // ShouldQuit is a function that is called when the user tries to quit the application.
+ // If the function returns true, the application will quit.
+ // If the function returns false, the application will not quit.
+ ShouldQuit func() bool
+}
+
+// AssetOptions defines the configuration of the AssetServer.
+type AssetOptions struct {
+ // Handler which serves all the content to the WebView.
+ 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.
+ //
+ // This middleware injects itself before any of Wails internal middlewares.
+ //
+ // If not defined, the default AssetServer request chain is executed.
+ //
+ // Multiple Middlewares can be chained together with:
+ // ChainMiddleware(middleware ...Middleware) Middleware
+ Middleware Middleware
+
+ // DisableLogging disables logging of the AssetServer. By default, the AssetServer logs every request.
+ DisableLogging bool
+}
+
+// Middleware defines 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.
+type Middleware func(next http.Handler) http.Handler
+
+// ChainMiddleware allows chaining multiple middlewares to one middleware.
+func ChainMiddleware(middleware ...Middleware) Middleware {
+ return func(h http.Handler) http.Handler {
+ for i := len(middleware) - 1; i >= 0; i-- {
+ h = middleware[i](h)
+ }
+ return h
+ }
+}
+
+// AssetFileServerFS returns a http handler which serves the assets from the fs.FS.
+// If an external devserver has been provided 'FRONTEND_DEVSERVER_URL' the files are being served
+// from the external server, ignoring the `assets`.
+func AssetFileServerFS(assets fs.FS) http.Handler {
+ return assetserver.NewAssetFileServer(assets)
+}
+
+// BundledAssetFileServer returns a http handler which serves the assets from the fs.FS.
+// If an external devserver has been provided 'FRONTEND_DEVSERVER_URL' the files are being served
+// from the external server, ignoring the `assets`.
+// It also serves the compiled runtime.js file at `/wails/runtime.js`.
+// It will provide the production runtime.js file from the embedded assets if the `production` tag is used.
+func BundledAssetFileServer(assets fs.FS) http.Handler {
+ return assetserver.NewBundledAssetFileServer(assets)
+}
+
+/******** Mac Options ********/
+
+// ActivationPolicy is the activation policy for the application.
+type ActivationPolicy int
+
+const (
+ // ActivationPolicyRegular is used for applications that have a user interface,
+ 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
+)
+
+// MacOptions contains options for macOS applications.
+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
+}
+
+/****** Windows Options *******/
+
+// WindowsOptions contains options for Windows applications.
+type WindowsOptions struct {
+
+ // WndProcInterceptor is a function that will be called for every message sent in the application.
+ // Use this to hook into the main message loop. This is useful for handling custom window messages.
+ // If `shouldReturn` is `true` then `returnCode` will be returned by the main message loop.
+ // If `shouldReturn` is `false` then returnCode will be ignored and the message will be processed by the main message loop.
+ WndProcInterceptor func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnCode uintptr, shouldReturn bool)
+
+ // DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
+ DisableQuitOnLastWindowClosed bool
+
+ // Path where the WebView2 stores the user data. If empty %APPDATA%\[BinaryName.exe] will be used.
+ // If the path is not valid, a messagebox will be displayed with the error and the app will exit with error code.
+ WebviewUserDataPath string
+
+ // Path to the directory with WebView2 executables. If empty WebView2 installed in the system will be used.
+ WebviewBrowserPath string
+}
+
+/********* Linux Options *********/
+
+// LinuxOptions contains options for Linux applications.
+type LinuxOptions struct {
+ // DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
+ DisableQuitOnLastWindowClosed bool
+
+ // ProgramName is used to set the program's name for the window manager via GTK's g_set_prgname().
+ //This name should not be localized. [see the docs]
+ //
+ //When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's Name
+ //property differs form the executable's filename.
+ //
+ //[see the docs]: https://docs.gtk.org/glib/func.set_prgname.html
+ ProgramName string
+}
+API: ShowAboutDialog()
ShowAboutDialog() shows an "About" dialog box. It can show the application's
+name, description and icon.
API: InfoDialog()
InfoDialog() creates and returns a new instance of MessageDialog with an
+InfoDialogType. This dialog is typically used to display informational
+messages to the user.
API: QuestionDialog()
QuestionDialog() creates and returns a new instance of MessageDialog with a
+QuestionDialogType. This dialog is often used to ask a question to the user
+and expect a response.
API: WarningDialog()
WarningDialog() creates and returns a new instance of MessageDialog with a
+WarningDialogType. As the name suggests, this dialog is primarily used to
+display warning messages to the user.
API: ErrorDialog()
ErrorDialog() creates and returns a new instance of MessageDialog with an
+ErrorDialogType. This dialog is designed to be used when you need to display
+an error message to the user.
API: OpenFileDialog()
OpenFileDialog() creates and returns a new OpenFileDialogStruct. This dialog
+prompts the user to select one or more files from their file system.
API: SaveFileDialog()
SaveFileDialog() creates and returns a new SaveFileDialogStruct. This dialog
+prompts the user to choose a location on their file system where a file should
+be saved.
API: OpenDirectoryDialog()
OpenDirectoryDialog() creates and returns a new instance of MessageDialog
+with an OpenDirectoryDialogType. This dialog enables the user to choose a
+directory from their file system.
API:
+On(eventType events.ApplicationEventType, callback func(event *Event)) func()
On() registers an event listener for specific application events. The callback
+function provided will be triggered when the corresponding event occurs. The
+function returns a function that can be called to remove the listener.
API:
+RegisterHook(eventType events.ApplicationEventType, callback func(event *Event)) func()
RegisterHook() registers a callback to be run as a hook during specific
+events. These hooks are run before listeners attached with On(). The function
+returns a function that can be called to remove the hook.
API: RegisterContextMenu(name string, menu *Menu)
RegisterContextMenu() registers a context menu with a given name. This menu
+can be used later in the application.
// Create a new menu
+ ctxmenu := app.NewMenu()
+
+ // Register the menu as a context menu
+ app.RegisterContextMenu("MyContextMenu", ctxmenu)
+API: SetMenu(menu *Menu)
SetMenu() sets the menu for the application. On Mac, this will be the global
+menu. For Windows and Linux, this will be the default menu for any new window
+created.
API: GetPrimaryScreen() (*Screen, error)
GetPrimaryScreen() returns the primary screen of the system.
API: GetScreens() ([]*Screen, error)
GetScreens() returns information about all screens attached to the system.
This is a brief summary of the exported methods in the provided App struct. Do
+note that for more detailed functionality or considerations, refer to the actual
+Go code or further internal documentation.
API: NewWebviewWindow() *WebviewWindow
NewWebviewWindow() creates a new Webview window with default options, and
+returns it.
API:
+NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindow
NewWebviewWindowWithOptions() creates a new webview window with custom
+options. The newly created window is added to a map of windows managed by the
+application.
// Create a new webview window with custom options
+ window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
+ Name: "Main",
+ Title: "My Window",
+ Width: 800,
+ Height: 600,
+ })
+API: OnWindowCreation(callback func(window *WebviewWindow))
OnWindowCreation() registers a callback function to be called when a window is
+created.
// Register a callback to be called when a window is created
+ app.OnWindowCreation(func(window *WebviewWindow) {
+ // Do something
+ })
+API: GetWindowByName(name string) *WebviewWindow
GetWindowByName() fetches and returns a window with a specific name.
API: CurrentWindow() *WebviewWindow
CurrentWindow() fetches and returns a pointer to the currently active window
+in the application. If there is no window, it returns nil.
These methods are utility functions to run code on the main thread. This is +required when you want to run custom code on the UI thread.
+API: InvokeSync(fn func())
This function runs the passed function (fn) synchronously. It uses a WaitGroup
+(wg) to ensure that the main thread waits for the fn function to finish
+before it continues. If a panic occurs inside fn, it will be passed to the
+handler function PanicHandler, defined in the application options.
API: InvokeSyncWithResult[T any](fn func() T) (res T)
This function works similarly to InvokeSync(fn func()), however, it yields a
+result. Use this for calling any function with a single return.
API: InvokeSyncWithError(fn func() error) (err error)
This function runs fn synchronously and returns any error that fn produces.
+Note that this function will recover from a panic if one occurs during fn's
+execution.
API:
+InvokeSyncWithResultAndError[T any](fn func() (T, error)) (res T, err error)
This function runs fn synchronously and returns both a result of type T and
+an error.
API: InvokeAsync(fn func())
This function runs fn asynchronously. It runs the given function on the main
+thread. If a panic occurs inside fn, it will be passed to the handler function
+PanicHandler, defined in the application options.
Note: These functions will block execution until fn has finished. It's
+critical to ensure that fn doesn't block. If you need to run a function that
+blocks, use InvokeAsync instead.
Menus can be created and added to the application. They can be used to create +context menus, system tray menus and application menus.
+To create a new menu, call:
+ +The following operations are then available on the Menu type:
API: Add(label string) *MenuItem
This method takes a label of type string as an input and adds a new
+MenuItem with the given label to the menu. It returns the MenuItem added.
API: AddSeparator()
This method adds a new separator MenuItem to the menu.
API: AddCheckbox(label string, enabled bool) *MenuItem
This method takes a label of type string and enabled of type bool as
+inputs and adds a new checkbox MenuItem with the given label and enabled state
+to the menu. It returns the MenuItem added.
API: AddRadio(label string, enabled bool) *MenuItem
This method takes a label of type string and enabled of type bool as
+inputs and adds a new radio MenuItem with the given label and enabled state to
+the menu. It returns the MenuItem added.
API: Update()
This method processes any radio groups and updates the menu if a menu +implementation is not initialized.
+API: AddSubmenu(s string) *Menu
This method takes a s of type string as input and adds a new submenu
+MenuItem with the given label to the menu. It returns the submenu added.
API: AddRole(role Role) *Menu
This method takes role of type Role as input, adds it to the menu if it is
+not nil and returns the Menu.
API: SetLabel(label string)
This method sets the label of the Menu.
The system tray houses notification area on a desktop environment, which can +contain both icons of currently-running applications and specific system +notifications.
+You create a system tray by calling app.NewSystemTray():
The following methods are available on the SystemTray type:
API: SetLabel(label string)
The SetLabel method sets the tray's label.
API: Label() string
The Label method retrieves the tray's label.
API: PositionWindow(*WebviewWindow, offset int) error
The PositionWindow method calls both AttachWindow and WindowOffset
+methods.
API: SetIcon(icon []byte) *SystemTray
The SetIcon method sets the system tray's icon.
API: SetDarkModeIcon(icon []byte) *SystemTray
The SetDarkModeIcon method sets the system tray's icon when in dark mode.
API: SetMenu(menu *Menu) *SystemTray
The SetMenu method sets the system tray's menu.
API: Destroy()
The Destroy method destroys the system tray instance.
API: OnClick(handler func()) *SystemTray
The OnClick method sets the function to execute when the tray icon is clicked.
API: OnRightClick(handler func()) *SystemTray
The OnRightClick method sets the function to execute when right-clicking the
+tray icon.
API: OnDoubleClick(handler func()) *SystemTray
The OnDoubleClick method sets the function to execute when double-clicking the
+tray icon.
API: OnRightDoubleClick(handler func()) *SystemTray
The OnRightDoubleClick method sets the function to execute when right
+double-clicking the tray icon.
API: AttachWindow(window *WebviewWindow) *SystemTray
The AttachWindow method attaches a window to the system tray. The window will
+be shown when the system tray icon is clicked.
API: WindowOffset(offset int) *SystemTray
The WindowOffset method sets the gap in pixels between the system tray and the
+window.
API: WindowDebounce(debounce time.Duration) *SystemTray
The WindowDebounce method sets a debounce time. In the context of Windows,
+this is used to specify how long to wait before responding to a mouse up event
+on the notification icon.
API: OpenMenu()
The OpenMenu method opens the menu associated with the system tray.
To create a window, use +Application.NewWebviewWindow or +Application.NewWebviewWindowWithOptions. +The former creates a window with default options, while the latter allows you to +specify custom options.
+These methods are callable on the returned WebviewWindow object:
+API: SetTitle(title string) *WebviewWindow
This method updates the window title to the provided string. It returns the +WebviewWindow object, allowing for method chaining.
+API: Name() string
This function returns the name of the WebviewWindow.
+API: SetSize(width, height int) *WebviewWindow
This method sets the size of the WebviewWindow to the provided width and height +parameters. If the dimensions provided exceed the constraints, they are adjusted +appropriately.
+API: SetAlwaysOnTop(b bool) *WebviewWindow
This function sets the window to stay on top based on the boolean flag provided.
+API: Show() *WebviewWindow
Show method is used to make the window visible. If the window is not running,
+it first invokes the run method to start the window and then makes it visible.
API: Hide() *WebviewWindow
Hide method is used to hide the window. It sets the hidden status of the
+window to true and emits the window hide event.
API: SetURL(s string) *WebviewWindow
SetURL method is used to set the URL of the window to the given URL string.
API: SetZoom(magnification float64) *WebviewWindow
SetZoom method sets the zoom level of the window content to the provided
+magnification level.
API: GetZoom() float64
GetZoom function returns the current zoom level of the window content.
API: GetScreen() (*Screen, error)
GetScreen method returns the screen on which the window is displayed.
API: SetFrameless(frameless bool) *WebviewWindow
This function is used to remove the window frame and title bar. It toggles the +framelessness of the window according to the boolean value provided (true for +frameless, false for framed).
+API: RegisterContextMenu(name string, menu *Menu)
This function is used to register a context menu and assigns it the given name.
+API: NativeWindowHandle() (uintptr, error)
This function is used to fetch the platform native window handle for the window.
+API: Focus()
This function is used to focus the window.
+API: SetEnabled(enabled bool)
This function is used to enable/disable the window based on the provided boolean +value.
+API: SetAbsolutePosition(x int, y int)
This function sets the absolute position of the window in the screen.
+ + + + + + + + + + + + + +{"use strict";var fs=/["'&<>]/;di.exports=us;function us(e){var t=""+e,r=fs.exec(t);if(!r)return t;var o,n="",i=0,s=0;for(i=r.index;i Mae'r API cais yn cynorthwyo i greu cais gan ddefnyddio fframwaith Wails. API: Os bydd gwall yn ystod y cychwyn, caiff y cais ei atal gyda'r neges gwall a ddarperir. Dylid nodi, os oes enghraifft gyffredinol o gais yn bodoli eisoes, y bydd yr enghraifft honno'n cael ei dychwelyd yn hytrach na chreu un newydd. API: API: API: API: API: API: API: Dyma'r testun wedi'i gyfieithu i'r Gymraeg: API: Mae API:
+ Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API:
+ Mae API:
+ Mae API: Mae API: Mae Dyma grynodeb byr o'r dulliau allforio yn y API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API: Mae API:
+ Mae API:
+ Mae API: Mae API: Mae API: Mae API: Mae Dyma grynodeb byr o'r dulliau allforio yn y Dyma'r testun wedi'i gyfieithu i'r Gymraeg: API: Mae API:
+ Mae API: Mae API: Mae API: Mae Mae'r dulliau hyn yn swyddogaethau cymorth i redeg cod ar y prif drywydd. Mae hyn yn
+ofynnol pan fyddwch am redeg cod cyfaddas ar y llwyfan UI. API: Mae'r swyddogaeth hon yn rhedeg y swyddogaeth a drosglwyddwyd ( API: Mae'r swyddogaeth hon yn gweithio'n debyg i API: Mae'r swyddogaeth hon yn rhedeg API:
+ Mae'r swyddogaeth hon yn rhedeg API: Mae'r swyddogaeth hon yn rhedeg Sylw: Bydd y swyddogaethau hyn yn rhwystro gweithrediad nes bod Gellir creu a chynnwys dewislenni yn y rhaglen. Gellir eu defnyddio i greu
+dewislenni cyd-destun, dwylo system a dewislenni rhaglen. I greu dewislen newydd, galwch: Mae'r gweithrediadau canlynol ar gael ar y API: Mae'r dull hwn yn cymryd API: Mae'r dull hwn yn ychwanegu API: Mae'r dull hwn yn cymryd API: Mae'r dull hwn yn cymryd API: Mae'r dull hwn yn prosesu unrhyw grwpiau radio ac yn diweddaru'r ddewislen os
+na chaiff y rhyngwyneb dewislen ei gychwyn. API: Mae'r dull hwn yn cymryd API: Mae'r dull hwn yn cymryd API: Mae'r dull hwn yn gosod Mae'r ardal hysbysu yn cynnwys ardal hysbysu ar amgylchedd bwrdd gwaith, a all
+gynnwys eiconau o'r rhaglenni sy'n rhedeg ar hyn o bryd a hysbysiadau system
+penodol. Rydych yn creu ardal hysbysu trwy alw Mae'r dulliau canlynol ar gael ar y API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull I greu ffenestr, defnyddiwch
+Application.NewWebviewWindow neu
+Application.NewWebviewWindowWithOptions.
+Mae'r cyntaf yn creu ffenestr gyda nodweddion rhagosodedig, tra bod yr olaf yn
+caniatáu i chi bennu opsiynau wedi'u haddasu. Mae'r dulliau hyn yn galladwy ar y gwrthrych WebviewWindow a ddychwelir: API: Mae'r dull hwn yn diweddaru teitl y ffenestr i'r llinyn a ddarperir. Mae'n dychwelyd
+y gwrthrych WebviewWindow, gan ganiatáu i ddulliau gael eu cadwyn. API: Mae'r swyddogaeth hon yn dychwelyd enw'r WebviewWindow. API: Mae'r dull hwn yn gosod maint y WebviewWindow i'r lled a'r uchder a ddarperir. Os
+yw'r dimensiynau a ddarparwyd yn rhagori ar y cyfyngiadau, mae'n eu haddasu'n briodol. API: Mae'r swyddogaeth hon yn gosod y ffenestr i aros ar y brig yn seiliedig ar y blaen
+llinyn a ddarperir. API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r dull API: Mae'r swyddogaeth API: Mae'r dull API: Mae'r swyddogaeth hon yn cael ei defnyddio i dynnu'r ffrâm a bar teitl y ffenestr.
+Mae'n toglo'r framelessness o'r ffenestr yn unol â'r gwerth boolean a ddarperir
+(gwir ar gyfer frameless, ffug ar gyfer ffrâm). API: Mae'r swyddogaeth hon yn cael ei defnyddio i gofrestru dewislen cyd-destun ac
+yn ei neilltuo i'r enw a ddarparwyd. API: Mae'r swyddogaeth hon yn cael ei defnyddio i nodi'r handlen ffenestr brodorol
+ar gyfer y ffenestr. API: Mae'r swyddogaeth hon yn cael ei defnyddio i ffocysu'r ffenestr. API: Mae'r swyddogaeth hon yn cael ei defnyddio i alluogi/analluogi'r ffenestr yn
+seiliedig ar y gwerth boolean a ddarperir. API: Mae'r swyddogaeth hon yn gosod y safle absoliwt o'r ffenestr yn y sgrin. Note Mae hwn ar hyn o bryd yn ddampio meddwl heb ei drefnu o newidiadau. Bydd yn cael ei drefnu i fformat mwy darllenadwy yn fuan. In v3, there are 3 types of events: Application events are events that are emitted by the application. These events
+include native events such as Window events are events that are emitted by a window. These events include
+native events such as Events that the user defines are called The data associated with a WailsEvent is now a single value. If multiple values
+are required, then a struct can be used. The signatures events callbacks (as used by Similarly, the In v2, Event Hooks are a new feature in v3. They allow you to hook into the event
+system and perform actions when certain events are emitted. For example, you can
+hook into the When emitting an event in Go, it will dispatch the event to local Go listeners
+and also each window in the application. When emitting an event in JS, it now
+sends the event to the application. This will be processed as if it was emitted
+in Go, however the sender ID will be that of the window. The Window API has largely remained the same, however the methods are now on an
+instance of a window rather than the runtime. Some notable differences are: In v2, this was a pointer to an This flag has been removed. Now there is a On Windows, if the Wails 3 comes with a built-in systray. This is a fully featured systray that has
+been designed to be as simple as possible to use. It is possible to set the
+icon, tooltip and menu of the systray. It is possible to also "attach" a window
+to the systray. Doing this will provide the following functionality: On macOS, if there is no attached window, the systray will use the default
+method of displaying the menu (any button). If there is an attached window but
+no menu, the systray will toggle the window regardless of the button pressed. Bindings work in a similar way to v2, by providing a means to bind struct
+methods to the frontend. These can be called in the frontend using the binding
+wrappers generated by the Bound methods are obfuscated by default, and are identified using uint32 IDs,
+calculated using the
+FNV hashing algorithm.
+This is to prevent the method name from being exposed in production builds. In
+debug mode, the method IDs are logged along with the calculated ID of the method
+to aid in debugging. If you wish to add an extra layer of obfuscation, you can
+use the Example: We can now call using this alias in the frontend: If you don't mind your calls being available in plain text in your binary and
+have no intention of using garble, then
+you can use the insecure Danger This is only provided as a convenience method for development. It is not recommended to use this in production. Native drag and drop can be enabled per-window. Simply set the
+ Context menus are contextual menus that are shown when the user right-clicks on
+an element. Creating a context menu is the same as creating a standard menu , by
+using To indicate that an element has a context menu, add the It is possible to register a context menu at the application level, making it
+available to all windows. This can be done using
+ Dialogs are now available in JavaScript! Dialog buttons in Windows are not configurable and are constant depending on the
+type of dialog. To trigger a callback when a button is pressed, create a button
+with the same name as the button you wish to have the callback attached to.
+Example: Create a button with the label The clipboard API has been simplified. There is now a single The Wails Markup Language is a simple markup language that allows you to add
+functionality to standard HTML elements without the use of Javascript. The following tags are currently supported: This specifies that a Wails event will be emitted when the element is clicked.
+The value of the attribute should be the name of the event to emit. Example: Sometimes you need the user to confirm an action. This can be done by adding the
+ Example: Any This attribute specifies which javascript event should trigger the action. The
+default is Plugins are a way to extend the functionality of your Wails application. Plugins are standard Go structure that adhere to the following interface: The The The The The In Go, enums are often defined as a type and a set of constants. For example: Due to incompatibility between Go and JavaScript, custom types cannot be used in
+this way. The best strategy is to use a type alias for float64: In Javascript, you can then use the following: Logging in v2 was confusing as both application logs and system (internal) logs
+were using the same logger. We have simplified this as follows: If this is set, the WndProc will be intercepted and the function will be called.
+This allows you to handle Windows messages directly. The function should have
+the following signature: The In v2, there was the In v2, the We would have ideally liked to use Dyma'r cyfieithiad i'r gymraeg: Mae rhwymedigaethau yn gweithio mewn modd tebyg i v2, drwy ddarparu ffordd i rwymo
+dulliau strwythur i'r rhyngwyneb blaen. Gellir eu galw yn y rhyngwyneb blaen gan
+ddefnyddio'r wraperi rhwymedigaeth a gynhyrchwyd gan y gorchymyn Mae dulliau rhwymo wedi'u cuddio'n ddiofyn, ac maent yn cael eu hadnabod gan IDs uint32,
+a gyfrifir gan ddefnyddio'r algorithm hasio FNV.
+Mae hyn er mwyn atal enw'r dull rhag cael ei ddatgelu mewn adeiladau cynhyrchiol. Mewn
+modd dadfygio, mae'r IDs dull yn cael eu logio ynghyd â'r ID a gyfrifwyd o'r dull
+i helpu i ddadfygio. Os ydych chi am ychwanegu haen arall o guddio, gallwch
+ddefnyddio'r opsiwn Enghraifft: Nawr gallwn alw gan ddefnyddio'r alias hwn yn y rhyngwyneb blaen: Os nad ydych chi'n poeni am eich galwadau yn cael eu cyhoeddi mewn testun plaen yn eich binari
+ac nid oes gennych fwriad o ddefnyddio garble, yna
+gallwch ddefnyddio'r dull Angen Darperir hwn dim ond fel dull cyfleustra ar gyfer datblygu. Ni chyngherir i'w ddefnyddio mewn cynhyrchiad. Mae API y clipfwrdd wedi'i symleiddio. Mae bellach un gwrthrych Mae dewislenni cyd-destun yn ddewislenni cyd-destunol a ddangosir pan fydd y
+defnyddiwr yn clicio'n dde ar elfen. Mae creu dewislen gyd-destun yr un peth â
+chreu dewislen safonol, gan ddefnyddio I nodi bod gan elfen ddewislen gyd-destun, ychwanegwch y priodoledd
+ Mae'n bosibl cofrestru dewislen gyd-destun ar lefel y cymhwysiad, gan ei
+gwneud ar gael i bob ffenestr. Gellir gwneud hyn gan ddefnyddio
+ Mae sgyrsiau bellach ar gael yn JavaScript! Nid yw botymau sgyrsiau yn Windows yn ffurfweddadwy ac yn gyson yn dibynnu ar y
+math o sgwrs. I drîgeru galwad enw pan fo botwm yn cael ei wasgu, crëwch botwm
+â'r un enw â'r botwm yr ydych am gael y galwad enw i'w gysylltu ag ef.
+Enghraifft: Crëwch fotwm â'r label Gellir galluogi llusgo a gollwng brodorol fesul ffenest. Yn syml, gosodwch yr
+opsiwn cyflunio ffenest Yng Ngo, mae enawau yn aml yn cael eu diffinio fel math a set o gysonau. Er enghraifft: Oherwydd anghydnawsedd rhwng Go a JavaScript, ni ellir defnyddio mathau custom mewn
+ffordd hon. Y strategaeth orau yw defnyddio alias math ar gyfer float64: Yn JavaScript, gallwch chi wedyn ddefnyddio'r canlynol: Yn v3, mae 3 math o ddigwyddiadau: Mae digwyddiadau cymhwysiad yn ddigwyddiadau a allbynir gan y cymhwysiad. Mae'r digwyddiadau hyn yn cynnwys digwyddiadau brodorol fel Mae digwyddiadau ffenestr yn ddigwyddiadau a allbynir gan ffenestr. Mae'r digwyddiadau hyn yn cynnwys digwyddiadau brodorol fel Mae'r digwyddiadau y mae'r defnyddiwr yn eu diffinio yn cael eu galw Mae'r data sy'n gysylltiedig â WailsEvent bellach yn un gwerth. Os oes angen mwy nag un gwerth, gellir defnyddio strwythur. Mae llofnodion y galwadau digwyddiad (fel y defnyddir gan Yn yr un modd, mae'r swyddogaeth Yn v2, byddai galwadau Mae Bachau Digwyddiad yn nodwedd newydd yn v3. Maent yn caniatáu i chi fachlu i mewn i'r system ddigwyddiadau a chyflawni gweithredoedd pan fydd digwyddiadau penodol yn cael eu hallbynnu. Er enghraifft, gallwch fachlu i mewn i'r digwyddiad Pan allbynwch ddigwyddiad yn Go, bydd yn dosbarthu'r digwyddiad i wrrandawyr Go lleol a hefyd i bob ffenestr yn y cymhwysiad. Pan allbynwch ddigwyddiad yn JS, mae'n nawr yn anfon y digwyddiad at y cymhwysiad. Caiff hwn ei brosesu fel petai wedi ei allbynnu yn Go, fodd bynnag bydd ID y anfonwr yn bod hwnnw o'r ffenestr. Roedd cofnodi yn v2 yn ddryslyd gan fod cofnodion cymhwysiad a chofnodion system (mewnol) yn defnyddio'r un cofnodwr. Rydym wedi ei symleiddio fel a ganlyn: Os caiff hwn ei osod, bydd WndProc yn cael ei ychwanegu ac fe gaiff y swyddogaeth ei galw.
+Mae hyn yn caniatáu i chi ddelio â negeseuon Windows yn uniongyrchol. Dylai'r swyddogaeth
+fod â'r llofnod canlynol: Dylid gosod y gwerth Yn v2, roedd y fflag Yn v2, defnyddiwyd yr ymddangosiad Byddem wedi hoffi defnyddio Mae ategion yn ffordd o ymestyn swyddogaeth eich cais Wails. Mae ategion yn strwythur Go safonol sy'n cydymffurfio â'r rhyngwyneb canlynol: Mae'r dull Mae'r dull Mae'r dull Mae'r dull Mae'r dull Mae Wails 3 yn dod â syscynhwysydd adeiledig-mewn. Mae hwn yn syscynhwysydd wedi'i gyflawni'n llawn sydd wedi'i ddylunio i fod mor syml â phosibl i'w ddefnyddio. Mae'n bosibl gosod yr eicon, y frawsfyriad a'r dewislen y syscynhwysydd. Mae'n bosibl hefyd "atodi" ffenestr i'r syscynhwysydd. Gan wneud hyn, bydd y swyddogaethau canlynol ar gael: Ar macOS, os nad oes ffenestr atodedig, bydd y syscynhwysydd yn defnyddio'r dull rhagosodedig o arddangos y ddewislen (unrhyw botwm). Os oes ffenestr atodedig ond dim dewislen, bydd y syscynhwysydd yn ymhallu'r ffenestr waeth pa fotwm a wasgerir. Mae'r API Ffenestr wedi aros yn yr un fath i raddau helaeth, fodd bynnag mae'r dulliau yn awr ar enghraifft o ffenestr yn hytrach na'r amser gweithredu. Rhai gwahaniaeth nodedig yw: Yn v2, roedd hwn yn bwynt i strwythur Mae'r fflach hon wedi'i thynnu. Erbyn hyn mae gan Ar Windows, os yw'r Mae'r Iaith Marcio Wails yn iaith farcio syml sy'n caniatáu i chi ychwanegu
+swyddogaeth at elfennau HTML safonol heb ddefnyddio JavaScript. Mae'r tagiau canlynol yn cael eu cefnogi ar hyn o bryd: Mae hyn yn pennu y bydd digwyddiad Wails yn cael ei allyrru pan gliciwyd ar yr
+elfen. Dylai gwerth yr priodoledd fod yn enw'r digwyddiad i'w allyrru. Enghraifft: Weithiau mae angen i'r defnyddiwr gadarnhau gweithred. Gellir gwneud hyn drwy
+ychwanegu'r briodoledd Enghraifft: Gellir galw unrhyw fethododd Mae'r briodoledd hwn yn pennu pa ddigwyddiad JavaScript ddylai ysgogi'r
+weithred. Y rhagosodiad yw Dyma'r cyfieithiad Cymraeg (cym) o'r testun Saesneg: Note Mae'r canllaw hwn yn gweithio ymlaen. Diolch am ddymuno helpu gyda datblygu Wails! Bydd y canllaw hwn yn eich helpu i
+gychwyn. Gosodwch y CLI: Dewisol: Os ydych am ddefnyddio'r system adeiladu i adeiladu cod blaen, bydd
+ angen i chi osod npm. Ar gyfer rhaglenni syml, gallwch ddefnyddio'r gorchymyn Mae Wails hefyd yn cynnwys system adeiladu y gellir ei defnyddio i adeiladu
+prosiectau mwy cymhleth. Mae'n defnyddio'r system adeiladu wych
+Task. Am fwy o wybodaeth, gwiriwch y dudalen gartref Task
+neu runnwch Mae'r prosiect yn cael y strwythur canlynol: Rydym yn monitro materion hysbys a thasgau ar hyn o bryd yn y
+Rhestr Tasgau Alpha. Os ydych am
+helpu, edrychwch ar y rhestr hon a dilyn y cyfarwyddiadau yn y
+Adborth tudalen. Y ffordd well o ychwanegu swyddogaeth ffenestr yw ychwanegu swyddogaeth newydd i'r
+ffeil Dylai'r rhan fwyaf, os nad y cyfan, o'r cod platfform penodol gael ei redeg ar y
+prif drywydd. Er mwyn symleiddio hyn, mae nifer o ddulliau Mae'r runtime wedi'i leoli yn Diffinnir digwyddiadau yn Mae nifer o fathau o ddigwyddiadau: digwyddiadau platfform penodol i'r ap a'r
+ffenestr + digwyddiadau cyffredin. Mae'r digwyddiadau cyffredin yn ddefnyddiol ar
+gyfer trin digwyddiadau ar draws platfformau, ond nid ydych wedi'ch cyfyngu i'r "isaf
+cyffredin". Gallwch ddefnyddio'r digwyddiadau platfform penodol os oes angen i chi. Wrth ychwanegu digwyddiad cyffredin, sicrhewch fod y digwyddiadau platfform penodol
+wedi'u mapio. Mae enghraifft o hyn yn NODYN: Efallai y byddwn yn ceisio awtomeiddio hyn yn y dyfodol drwy ychwanegu'r
+mapio at y diffiniad digwyddiad. Mae addasiadau yn ffordd o estyn swyddogaeth eich ap Wails. Mae addasiadau yn strwythur Go safonol sy'n cydymffurfio â'r rhyngwyneb canlynol: Mae'r dull Mae'r dull Gelwir y dull Mae'r dull Mae'r dull Cewch hyd i'r addasiadau mewnol yn y cyfeiriadur Mae'r CLI Wails yn defnyddio'r system adeiladu Task. Fe'i
+mewnforiwyd fel llyfrgell a'i ddefnyddio i redeg y tasgau a ddiffinnir yn
+ I wirio a oes diweddariad ar gyfer Taskfile, rhedwch I uwchraddio'r fersiwn o Taskfile a ddefnyddir, rhedwch: Os oes anghydnawsedd, dylai'r rhain ymddangos yn y ffeil
+ Fel arfer, y ffordd orau o drwsio anghydnawsedd yw clonio'r storfa dasg yn
+ I wirio bod yr holl newidiadau wedi gweithio'n gywir, ail-osodwch y CLI a gwirio'r
+fersiwn eto: Gwnewch yn siŵr bod gan bob PR docyn cysylltiedig â nhw sy'n darparu cyd-destun y
+newid. Os nad oes tocyn, crëwch un yn gyntaf. Sicrhewch fod pob PR wedi
+diweddaru'r ffeil CHANGELOG.md gyda'r newidiadau a wnaed. Mae'r ffeil CHANGELOG.md
+wedi'i lleoli yn y cyfeiriadur Mae'r CLI Wails yn defnyddio'r system adeiladu Task. Fe'i
+mewnforiwyd fel llyfrgell a'i ddefnyddio i redeg y tasgau a ddiffinnir yn
+ I wirio a oes diweddariad ar gyfer Taskfile, rhedwch I uwchraddio'r fersiwn o Taskfile a ddefnyddir, rhedwch: Os oes anghydnawsedd, dylai'r rhain ymddangos yn y ffeil
+ Fel arfer, y ffordd orau o drwsio anghydnawsedd yw clonio'r storfa dasg yn
+ I wirio bod yr holl newidiadau wedi gweithio'n gywir, ail-osodwch y CLI a gwirio'r
+fersiwn eto: Dyma'r cyfieithiad Cymraeg (cym): Statws nodweddion yn v3. Note Dulliau rhyngwyneb cymhwyster Dulliau Rhyngwyneb Ffenestr Gwe-weld Mae'r ddewislen cyd-destun rhagosodedig wedi'i galluogi'n rhagosodedig ar gyfer yr holl elfennau sydd â Ni fydd unrhywbeth wedi'i nythu o dan tag â'r arddull I = Cefnogir U = Heb ei brofi Mae 'I' yn y tabl isod yn dangos bod yr opsiwn wedi'i brofi ac yn cael ei gymhwyso wrth greu'r ffenestr. Mae 'X' yn dangos nad yw'r opsiwn yn cael ei gefnogi gan y platfform. Croeso (ac anogaeth) i'ch adborth! Chwiliwch am docynnau neu
+bostiau presennol cyn creu rhai newydd. Dyma'r ffyrdd gwahanol i ddarparu adborth: Os ydych yn canfod nam, rhowch wybod i ni drwy bostio yn y v3 Alpha Feedback sianel ar Discord. Warning Cofiwch, nid yw ymddygiad annisgwyl o reidrwydd yn nam - efallai nad yw'n gwneud yr hyn yr ydych yn disgwyl iddo ei wneud. Defnyddiwch Awgrymiadau ar gyfer hyn. Os oes gennych gywiriad i nam neu ddiweddariad i'r ddogfennaeth, gwnewch y canlynol: Os oes gennych awgrym, rhowch wybod i ni drwy bostio yn y v3 Alpha Feedback sianel ar Discord: Cofiwch gysylltu â ni ar Discord os oes gennych unrhyw gwestiynau. Mae rhestr o broblemau hysbys a gwaith ar y gweill i'w gweld
+yma. I osod yr Wails CLI, sicrhewch eich bod wedi gosod Go 1.21+
+a rhedwch: Mae gan Wails nifer o ddibyniaeth cyffredin sydd eu hangen cyn gosod: Lawrlwythwch Go o'r Dudalen Lawrlwytho Go. Sicrhewch eich bod yn dilyn y cyfarwyddiadau gosod Go swyddogol. Bydd angen i chi hefyd sicrhau bod eich amrywiol amgylchedd Er nad oes angen npm i'w osod ar Wails, mae ei angen os ydych am ddefnyddio'r templed sydd wedi'i gynnwys. Lawrlwythwch y gosodwr node diweddaraf o'r Dudalen Lawrlwytho Node. Mae'n well defnyddio'r rhyddhad diweddaraf gan mai hwnnw yr ydym fel arfer yn ei brofi yn erbyn. Rhedwch Mae gan yr Wails CLI rhedwr tasg wedi'i ymgorffori o'r enw Task. Mae'n ddewisol, ond fe'i argymhellir. Os nad ydych am osod Task, gallwch ddefnyddio'r gorchymyn Bydd angen i chi hefyd osod dibyniaeth penodol i'r platfform: Mae angen i Wails fod â'r offer llinell orchymyn xcode wedi'u gosod. Gellir gwneud hyn trwy redeg: Mae angen i Wails fod â Rhedwr WebView2 wedi'i osod. Bydd rhai gosodiadau Windows eisoes wedi'i gael hwn wedi'i osod. Gallwch wirio hyn gan ddefnyddio'r gorchymyn Mae angen offer adeiladu Bydd rhedeg Os yw eich system yn adrodd bod y gorchymyn Nawr eich bod wedi creu eich cymhwysiad cyntaf, gallwch ddechrau archwilio'r nodweddion eraill y mae v3 alpha yn eu darparu. Y lle gorau i ddechrau yw'r cyfeiriadur I redeg enghraifft, gallwch ddefnyddio: yn y cyfeiriadur enghraifft. Nodyn Efallai na fydd rhai enghreifftiau'n gweithio yn ystod datblygiad alpha. Mae creu eich cymhwysiad cyntaf gyda Wails v3 Alpha yn daith gyffrous i mewn i fyd datblygu apiau bwrdd gwaith modern. Bydd y canllaw hwn yn mynd â chi drwy'r broses o greu cymhwysiad sylfaenol, gan ddangos pŵer a symlrwydd Wails. Cyn dechrau, sicrhewch eich bod wedi gosod y canlynol: Agorwch eich terfynell a rhedeg y gorchymyn canlynol i greu prosiect Wails newydd: Mae'r gorchymyn hwn yn creu cyfeiriadur newydd o'r enw Ewch i'r cyfeiriadur Cymerwch ennyd i archwilio'r ffeiliau hyn a'ch cyfarwyddo â'r strwythur. Note Er bod Wails v3 yn defnyddio Task fel ei system adeiladu ddiofyn, does dim byd yn atal chi rhag defnyddio I adeiladu eich cymhwysiad, rhedwch: Mae'r gorchymyn hwn yn cyfansoddi fersiwn dadfygio o'ch cymhwysiad ac yn ei gadw mewn cyfeiriadur Byddwch yn gweld rhyngwyneb defnyddiwr syml, pwynt cychwyn eich cymhwysiad. Gan ei fod yn fersiwn dadfygio, byddwch hefyd yn gweld logiau yn y ffenestr gonsol. Mae hyn yn ddefnyddiol at ddibenion dadfygio. Gallwn hefyd redeg y cymhwysiad yn y modd datblygu. Mae'r modd hwn yn caniatáu i chi wneud newidiadau i'ch cod rhagflaen a gweld y newidiadau'n cael eu hadlewyrchu yn y cymhwysiad sy'n rhedeg heb orfod ailadeiladu'r cyfan. Bydd y cymhwysiad yn diweddaru'n awtomatig, a byddwch yn gweld y newidiadau'n cael eu hadlewyrchu yn y cymhwysiad sy'n rhedeg. Pan fyddwch yn hapus gyda'ch newidiadau, ailadeiladu'r cymhwysiad eto: Byddwch yn sylwi bod yr amser adeiladu wedi bod yn gyflymach y tro hwn. Mae hynny oherwydd bod y system adeiladu newydd yn unig yn adeiladu'r rhannau o'ch cymhwysiad sydd wedi newid. Dylech weld gweithrediannol newydd yn y cyfeiriadur Llongyfarchiadau! Rydych newydd greu ac adeiladu eich cymhwysiad Wails cyntaf. Dyma ddechrau'r hyn y gallwch ei gyflawni gyda Wails v3 Alpha. Archwiliwch y ddogfennaeth, profwch y gwahanol nodweddion, a dechrau adeiladu apiau rhyfeddol! Croeso i ddogfennaeth alpha Wails v3. Dyma'r man cychwyn ar gyfer archwilio'r fersiwn ddiweddaraf o Wails, fframwaith pwerus ar gyfer adeiladu rhaglenni bwrdd gwaith gan ddefnyddio Go a thechnolegau gwe modern. Mae Wails v3 Alpha yn y diweddaraf o brosiect Wails, gan ddod â nodweddion newydd a gwelliannau i wneud datblygu rhaglenni bwrdd gwaith yn fwy effeithlon a difyr. Mae'r fersiwn hon dal yn alpha, felly efallai y bydd rhai nodweddion yn newid cyn y rhyddhad terfynol. Dyma rai o'r nodweddion a gwelliannau newydd cyffrous yn Wails v3 Alpha: Mae rhagor o wybodaeth am y nodweddion hyn a newidiadau eraill i'w chael yn yr adran Beth sydd Newydd. I gychwyn gyda Wails v3 Alpha: Sylwch fod hwn yn fersiwn alpha o Wails v3. Gall nodweddion gael eu hychwanegu, eu dileu neu eu newid mewn diweddariadau yn y dyfodol. Mae'r fersiwn hon wedi'i bwriadu ar gyfer cynnar-fabwysiadwyr a'r rheiny sy'n dymuno cyfrannu at ddatblygiad Wails. Mae eich adborth yn hanfodol i wneud Wails yn well. Os ydych yn dod ar draws unrhyw broblemau neu os oes gennych awgrymiadau, defnyddiwch ein Proses Adborth. Mae cyfraniadau at y prosiect hefyd yn croeso! Diolch am roi cynnig ar Wails v3 Alpha! Wails v3 introduces the concept of plugins. A plugin is a self-contained module that can extend the functionality of your Wails application.
+This guide will walk you through the structure and functionality of a Wails plugin. A Wails plugin is a standard Go module, typically consisting of the following files: In In addition to these methods, you can define any number of additional methods that implement the plugin's functionality.
+These methods can be called from the frontend using the The Any static assets that the plugin needs can be placed in the If a plugin named The Here's the Log plugin implementation: This plugin can be added to the application like this: If you encounter any issues with a plugin, please raise a ticket in the plugin's repository. Note The Wails team does not provide support for third-party plugins. Mae amser rhedeg Wails yn llyfrgell safonol ar gyfer ceisiadau Wails. Mae'n darparu nifer o nodweddion y gellir eu defnyddio yn eich ceisiadau, gan gynnwys: Mae'r amser rhedeg yn ofynnol ar gyfer integreiddio rhwng Go a'r rhaglen blaen. Mae 2 ffordd o integreiddio'r amser rhedeg: Mae'r pecyn Mae'r pecyn ar gael ar npm a gellir ei osod gan ddefnyddio: Bydd rhai prosiectau heb ddefnyddio pecynwr JavaScript ac efallai y byddant yn well ganddynt ddefnyddio fersiwn wedi'i chyn-adeiladu o'r amser rhedeg. Dyma'r rhagosodiad ar gyfer yr enghreifftiau yn Bydd hyn yn cynhyrchu ffeil Mae'r cynllun gweithredu yn ddogfen fyw ac yn agored i newid. Os oes gennych unrhyw awgrymiadau, agorwch fater. Bydd gan bob cam bwysig gyfres o nodau yr ydym yn anelu at eu cyflawni. Mae'r rhain yn agored i newid. Mae cylch Alpha 5 yn anelu at ddod â Linux i gydraddoldeb (Alpha 4) â'r platfformau eraill. Note Adroddwch unrhyw faterion a ganfyddwch gan ddefnyddio y canllaw hwn. Enghreifftiau Linux: Mae cylch Alpha 4 yn anelu at ddarparu'r gorchmynion Dylai'r gorchymyn Note Adroddwch unrhyw faterion a ganfyddwch gan ddefnyddio y canllaw hwn. Profi'r gorchymyn Profi'r gorchymyn Adolygwch y tabl isod a chwilio am senarios heb eu profi.
+Yn y bôn, ceisiwch ei dorri a rhowch wybod i ni os ydych yn dod o hyd i unrhyw faterion! Gorchymyn Mae newidiadau i Go yn achosi i'r cais gael ei adeiladu ddwywaith Mae Mac yn gweithio'n rhannol: Gorchymyn Mae cylch Alpha 3 yn anelu at ddarparu cefnogaeth rhwymau. Mae Wails 3 yn defnyddio dull dadansoddi státig newydd sy'n ein galluogi i ddarparu profiad rhwymau gwell nag yn Wails 2.
+Hefyd, rydym am gael pob enghraifft yn gweithio ar Linux. Gallwch gynhyrchu rhwymau gan ddefnyddio'r gorchymyn Mae'r profion ar gyfer y cynhyrchwr rhwymau i'w canfod yma gyda'r data profion wedi'i leoli yn y cyfeiriadur Adolygwch y tabl isod a chwilio am senarios heb eu profi. Mae'r cod parser a'r profion wedi'u lleoli yn Rhwymau ar gyfer strwythur (CallByID): Rhwymau ar gyfer strwythur (CallByName): Modelau: Enghreifftiau: Mae Alpha 2 yn anelu at gyflwyno cefnogaeth Taskfile. Bydd hyn yn
+caniatáu i ni gael system adeiladu unigol, estynnadwy sy'n gweithio ar bob platfform.
+Hefyd, rydym am gael pob enghraifft yn gweithio ar Linux. Gorchmynion Cychwyn a Adeiladu - Yn gweithio Mae Alpha 1 y rhyddhad cychwynnol. Mae'n fwriadedig i gael adborth ar yr API newydd
+ac i bobl ddechreu arbrofi ag ef. Y nod pennaf yw cael y rhan fwyaf o'r
+enghreifftiau yn gweithio ar bob platfform. Mae Wails v3 Alpha yn symud o'r API sengl-ffenestr, datganiadol o v2 i un proseduraidd. Mae'r API hwn cynnil yn gwneud datblygiad cod yn haws, yn gwella darllenadwyedd, ac yn datgloi apiau amlder-ffenestr cymhleth. Nid yw Wails v3 Alpha yn wella ar fersiwnau blaenorol yn unig - mae'n ailddychmygu galluoedd datblygu rhaglenni peiriannu gweledol gyda Go a thechnolegau gwe modern. Mae'n awr yn bosibl creu amlder ffenestri a ffurfweddu pob un ohonynt yn annibynnol. Mae systriedi yn caniatáu i chi ychwanegu eicon yn ardal y system dociau eich peiriant a chael y nodweddion canlynol: Mae Atchwanegion yn caniatáu i chi ehangu swyddogaeth y system Wails. Nid yn unig y gellir defnyddio dulliau atchwanegion yn Go, ond hefyd galw ohonynt o JavaScript. Atchwanegion a gynhwysir: Mae v3 yn defnyddio dadansoddwr statif newydd i gynhyrchu cysylltiadau. Mae hyn yn ei gwneud yn eithriadol o gyflym ac yn cynnal sylwadau a enwau paramedrau yn eich cysylltiadau. Yn ddiofyn, cynhyrchir cysylltiadau gyda galwadau gan ddefnyddio ID yn hytrach na throednodiadau. Mae hyn yn darparu hwb perfformiad ac yn caniatáu i chi ddefnyddio offer cuddio fel garble. Cynhyrchir cysylltiadau trwy redeg Yn v2, roedd y system adeiladu yn gwbl anhyglyw a chaled i'w addasu. Yn v3, mae'n bosibl adeiladu popeth gan ddefnyddio offer Go safonol. Mae'r holl waith trwm a wnaeth system adeiladu v2, fel cynhyrchu eicon, wedi'i ychwanegu fel gorchmynion offeryn yn y CLI. Rydyn ni wedi ymgorffori Taskfile yn y CLI i drefnu'r galwadau hyn i ddod â'r un profiad datblygwr â v2. Fodd bynnag, mae'r dull hwn yn dod â'r cydbwysedd perffaith o hyblygrwydd a hwylusder defnydd gan y gallwch nawr addasu'r broses adeiladu i'ch anghenion. Gallwch hyd yn oed ddefnyddio gwneud os mai dyna eich dewis! Caiff digwyddiadau eu hamlygu nawr ar gyfer llawer o'r gweithrediadau amser gweithredu, gan eich galluogi i glymu i mewn i ddigwyddiadau cymhwysiad/system. Caiff digwyddiadau trawsblat (cyffredin) hefyd eu hamlygu lle ceir digwyddiadau platfform cyffredin, gan eich galluogi i ysgrifennu'r un dulliau trin digwyddiadau ar draws platfformau. Gellir hefyd gofrestru bachau digwyddiad. Mae'r rhain fel y dull Nodwedd arbrofol i alw dulliau amser gweithredu gan ddefnyddio html plaen, yn debyg i
+htmx. Mae mwy o enghreifftiau ar gael yn y examples cyfeiriadur. Edrychwch arnynt! Note This is currently an unsorted brain dump of changes. It will be organised into a more readable format soon. In v3, there are 3 types of events: Application events are events that are emitted by the application. These events
+include native events such as Window events are events that are emitted by a window. These events include
+native events such as Events that the user defines are called The data associated with a WailsEvent is now a single value. If multiple values
+are required, then a struct can be used. The signatures events callbacks (as used by Similarly, the In v2, Event Hooks are a new feature in v3. They allow you to hook into the event
+system and perform actions when certain events are emitted. For example, you can
+hook into the When emitting an event in Go, it will dispatch the event to local Go listeners
+and also each window in the application. When emitting an event in JS, it now
+sends the event to the application. This will be processed as if it was emitted
+in Go, however the sender ID will be that of the window. The Window API has largely remained the same, however the methods are now on an
+instance of a window rather than the runtime. Some notable differences are: In v2, this was a pointer to an This flag has been removed. Now there is a On Windows, if the Wails 3 comes with a built-in systray. This is a fully featured systray that has
+been designed to be as simple as possible to use. It is possible to set the
+icon, tooltip and menu of the systray. It is possible to also "attach" a window
+to the systray. Doing this will provide the following functionality: On macOS, if there is no attached window, the systray will use the default
+method of displaying the menu (any button). If there is an attached window but
+no menu, the systray will toggle the window regardless of the button pressed. Bindings work in a similar way to v2, by providing a means to bind struct
+methods to the frontend. These can be called in the frontend using the binding
+wrappers generated by the Bound methods are obfuscated by default, and are identified using uint32 IDs,
+calculated using the
+FNV hashing algorithm.
+This is to prevent the method name from being exposed in production builds. In
+debug mode, the method IDs are logged along with the calculated ID of the method
+to aid in debugging. If you wish to add an extra layer of obfuscation, you can
+use the Example: We can now call using this alias in the frontend: If you don't mind your calls being available in plain text in your binary and
+have no intention of using garble, then
+you can use the insecure Danger This is only provided as a convenience method for development. It is not recommended to use this in production. Native drag and drop can be enabled per-window. Simply set the
+ Context menus are contextual menus that are shown when the user right-clicks on
+an element. Creating a context menu is the same as creating a standard menu , by
+using To indicate that an element has a context menu, add the It is possible to register a context menu at the application level, making it
+available to all windows. This can be done using
+ Dialogs are now available in JavaScript! Dialog buttons in Windows are not configurable and are constant depending on the
+type of dialog. To trigger a callback when a button is pressed, create a button
+with the same name as the button you wish to have the callback attached to.
+Example: Create a button with the label The clipboard API has been simplified. There is now a single The Wails Markup Language is a simple markup language that allows you to add
+functionality to standard HTML elements without the use of Javascript. The following tags are currently supported: This specifies that a Wails event will be emitted when the element is clicked.
+The value of the attribute should be the name of the event to emit. Example: Sometimes you need the user to confirm an action. This can be done by adding the
+ Example: Any This attribute specifies which javascript event should trigger the action. The
+default is Plugins are a way to extend the functionality of your Wails application. Plugins are standard Go structure that adhere to the following interface: The The The The The In Go, enums are often defined as a type and a set of constants. For example: Due to incompatibility between Go and JavaScript, custom types cannot be used in
+this way. The best strategy is to use a type alias for float64: In Javascript, you can then use the following: Logging in v2 was confusing as both application logs and system (internal) logs
+were using the same logger. We have simplified this as follows: If this is set, the WndProc will be intercepted and the function will be called.
+This allows you to handle Windows messages directly. The function should have
+the following signature: The In v2, there was the In v2, the We would have ideally liked to use Bindings work in a similar way to v2, by providing a means to bind struct
+methods to the frontend. These can be called in the frontend using the binding
+wrappers generated by the Bound methods are obfuscated by default, and are identified using uint32 IDs,
+calculated using the
+FNV hashing algorithm.
+This is to prevent the method name from being exposed in production builds. In
+debug mode, the method IDs are logged along with the calculated ID of the method
+to aid in debugging. If you wish to add an extra layer of obfuscation, you can
+use the Example: We can now call using this alias in the frontend: If you don't mind your calls being available in plain text in your binary and
+have no intention of using garble, then
+you can use the insecure Danger This is only provided as a convenience method for development. It is not recommended to use this in production. The clipboard API has been simplified. There is now a single Context menus are contextual menus that are shown when the user right-clicks on
+an element. Creating a context menu is the same as creating a standard menu , by
+using To indicate that an element has a context menu, add the It is possible to register a context menu at the application level, making it
+available to all windows. This can be done using
+ Dialogs are now available in JavaScript! Dialog buttons in Windows are not configurable and are constant depending on the
+type of dialog. To trigger a callback when a button is pressed, create a button
+with the same name as the button you wish to have the callback attached to.
+Example: Create a button with the label Native drag and drop can be enabled per-window. Simply set the
+ In Go, enums are often defined as a type and a set of constants. For example: Due to incompatibility between Go and JavaScript, custom types cannot be used in
+this way. The best strategy is to use a type alias for float64: In Javascript, you can then use the following: In v3, there are 3 types of events: Application events are events that are emitted by the application. These events
+include native events such as Window events are events that are emitted by a window. These events include
+native events such as Events that the user defines are called The data associated with a WailsEvent is now a single value. If multiple values
+are required, then a struct can be used. The signatures events callbacks (as used by Similarly, the In v2, Event Hooks are a new feature in v3. They allow you to hook into the event
+system and perform actions when certain events are emitted. For example, you can
+hook into the When emitting an event in Go, it will dispatch the event to local Go listeners
+and also each window in the application. When emitting an event in JS, it now
+sends the event to the application. This will be processed as if it was emitted
+in Go, however the sender ID will be that of the window. Logging in v2 was confusing as both application logs and system (internal) logs
+were using the same logger. We have simplified this as follows: If this is set, the WndProc will be intercepted and the function will be called.
+This allows you to handle Windows messages directly. The function should have
+the following signature: The In v2, there was the In v2, the We would have ideally liked to use Plugins are a way to extend the functionality of your Wails application. Plugins are standard Go structure that adhere to the following interface: The The The The The Wails 3 comes with a built-in systray. This is a fully featured systray that has
+been designed to be as simple as possible to use. It is possible to set the
+icon, tooltip and menu of the systray. It is possible to also "attach" a window
+to the systray. Doing this will provide the following functionality: On macOS, if there is no attached window, the systray will use the default
+method of displaying the menu (any button). If there is an attached window but
+no menu, the systray will toggle the window regardless of the button pressed. The Window API has largely remained the same, however the methods are now on an
+instance of a window rather than the runtime. Some notable differences are: In v2, this was a pointer to an This flag has been removed. Now there is a On Windows, if the The Wails Markup Language is a simple markup language that allows you to add
+functionality to standard HTML elements without the use of Javascript. The following tags are currently supported: This specifies that a Wails event will be emitted when the element is clicked.
+The value of the attribute should be the name of the event to emit. Example: Sometimes you need the user to confirm an action. This can be done by adding the
+ Example: Any This attribute specifies which javascript event should trigger the action. The
+default is Note This guide is a work in progress. Thanks for wanting to help out with development of Wails! This guide will help
+you get started. Install the CLI: Optional: If you are wanting to use the build system to build frontend code,
+ you will need to install npm. For simple programs, you can use the standard Wails also comes with a build system that can be used to build more complex
+projects. It utilises the awesome Task build system. For
+more information, check out the task homepage or run The project has the following structure: We are currently tracking known issues and tasks in the
+Alpha Todo List. If you want to
+help out, please check this list and follow the instructions in the
+Feedback page. The preferred way to add window functionality is to add a new function to the
+ Most, if not all, of the platform specific code should be run on the main
+thread. To simplify this, there are a number of The runtime is located in Events are defined in There are a number of types of events: platform specific application and window
+events + common events. The common events are useful for cross-platform event
+handling, but you aren't limited to the "lowest common denominator". You can use
+the platform specific events if you need to. When adding a common event, ensure that the platform specific events are mapped.
+An example of this is in NOTE: We may try to automate this in the future by adding the mapping to the
+event definition. Plugins are a way to extend the functionality of your Wails application. Plugins are standard Go structure that adhere to the following interface: The The The The The The built-in plugins can be found in the The Wails CLI uses the Task build system. It is imported
+as a library and used to run the tasks defined in To check if there's an upgrade for Taskfile, run To upgrade the version of Taskfile used, run: If there are incompatibilities then they should appear in the
+ Usually the best way to fix incompatibilities is to clone the task repo at
+ To check all changes have worked correctly, re-install the CLI and check the
+version again: Make sure that all PRs have a ticket associated with them providing context to
+the change. If there is no ticket, please create one first. Ensure that all PRs
+have updated the CHANGELOG.md file with the changes made. The CHANGELOG.md file
+is located in the The Wails CLI uses the Task build system. It is imported
+as a library and used to run the tasks defined in To check if there's an upgrade for Taskfile, run To upgrade the version of Taskfile used, run: If there are incompatibilities then they should appear in the
+ Usually the best way to fix incompatibilities is to clone the task repo at
+ To check all changes have worked correctly, re-install the CLI and check the
+version again: Status of features in v3. Note Application interface methods Webview Window Interface Methods The default context menu is enabled by default for all elements that are
+ Anything nested under a tag with Y = Supported U = Untested A 'Y' in the table below indicates that the option has been tested and is
+applied when the window is created. An 'X' indicates that the option is not
+supported by the platform. To log or not to log? System logger vs custom logger. Mapping native events to cross-platform events. ... Add more Working well. Working well. Contains a lot needed for development. TBD All templates are working. Built-in plugin support: TODO: Implementation details for the functions utilized by the By default CGO is utilized to compile the Linux port. This prevents easy
+cross-compilation and so the PureGo implementation is also being simultaneously
+developed. The examples can be compiled using the following command: Note: things are currently not working after the refactor We welcome (and encourage) your feedback! Please search for existing tickets or
+posts before creating new ones. Here are the different ways to provide feedback: If you find a bug, please let us know by posting into the v3 Alpha Feedback channel on Discord. Warning Remember, unexpected behaviour isn't necessarily a bug - it might just not do what you expect it to do. Use Suggestions for this. If you have a fix for a bug or an update for documentation, please do the following: If you have a suggestion, please let us know by posting into the v3 Alpha Feedback channel on Discord: Please feel free to reach out to us on Discord if you have any questions. There is a list of known issues & work in progress can be found
+here. To install the Wails CLI, ensure you have Go 1.21+
+installed and run: Wails has a number of common dependencies that are required before installation: Download Go from the Go Downloads Page. Ensure that you follow the official Go installation instructions. You will also need to ensure that your Although Wails doesn't require npm to be installed, it is needed if you want to use the bundled templates. Download the latest node installer from the Node Downloads Page. It is best to use the latest release as that is what we generally test against. Run The Wails CLI embeds a task runner called Task. It is optional, but recommended. If you do not wish to install Task, you can use the You will also need to install platform specific dependencies: Wails requires that the xcode command line tools are installed. This can be
+done by running: Wails requires that the WebView2 Runtime is installed. Some Windows installations will already have this installed. You can check using the Linux requires the standard Running If your system is reporting that the Now that you have created your first application, you can start exploring the other features that v3 alpha provides. The best place to start is the To run an example, you can simply use: in the example directory. Note Some examples may not work during alpha development. Creating your first application with Wails v3 Alpha is an exciting journey into the world of modern desktop app development. This guide will walk you through the process of creating a basic application, showcasing the power and simplicity of Wails. Before you begin, ensure you have the following installed: Open your terminal and run the following command to create a new Wails project: This command creates a new directory called Navigate to the Take a moment to explore these files and familiarize yourself with the structure. Note Although Wails v3 uses Task as its default build system, there is nothing stopping you from using To build your application, execute: This command compiles a debug version of your application and saves it in a new You'll see a simple UI, the starting point for your application. As it is the debug version, you'll also see logs in the console window. This is useful for debugging purposes. We can also run the application in development mode. This mode allows you to make changes to your frontend code and see the changes reflected in the running application without having to rebuild the entire application. The application will update automatically, and you'll see the changes reflected in the running application. Once you're happy with your changes, build your application again: You'll notice that the build time was faster this time. That's because the new build system only builds the parts of your application that have changed. You should see a new executable in the Congratulations! You've just created and built your first Wails application. This is just the beginning of what you can achieve with Wails v3 Alpha. Explore the documentation, experiment with different features, and start building amazing applications! Welcome to the Wails v3 Alpha documentation. This is your starting point for exploring the latest version of Wails, a powerful framework for building desktop applications using Go and modern web technologies. Wails v3 Alpha is the latest iteration of the Wails project, bringing new features and improvements to make desktop application development more efficient and enjoyable. This version is still in alpha, so some features might change before the final release. Here are some of the exciting new features and improvements in Wails v3 Alpha: More information about these features and other changes can be found in the What's new section. To get started with Wails v3 Alpha: Please note that this is an alpha version of Wails v3. Features may be added, removed, or changed in future updates. This version is intended for early adopters and those who wish to contribute to the development of Wails. Your feedback is vital to making Wails better. If you encounter any issues or have suggestions, please use our Feedback process. Contributions to the project are also welcome! Thank you for trying out Wails v3 Alpha! Wails v3 introduces the concept of plugins. A plugin is a self-contained module that can extend the functionality of your Wails application.
+This guide will walk you through the structure and functionality of a Wails plugin. A Wails plugin is a standard Go module, typically consisting of the following files: In In addition to these methods, you can define any number of additional methods that implement the plugin's functionality.
+These methods can be called from the frontend using the The Any static assets that the plugin needs can be placed in the If a plugin named The Here's the Log plugin implementation: This plugin can be added to the application like this: If you encounter any issues with a plugin, please raise a ticket in the plugin's repository. Note The Wails team does not provide support for third-party plugins. The Wails runtime is the standard library for Wails applications. It provides a number of features that may
+be used in your applications, including: The runtime is required for integration between Go and the frontend. There are 2 ways to integrate the runtime: The The package is available on npm and can be installed using: Some projects will not use a Javascript bundler and may prefer to use a pre-built version of the runtime. This is
+the default for the examples in This will generate a The roadmap is a living document and is subject to change. If you have any
+suggestions, please open an issue. Each milestone will have a set of goals that
+we are aiming to achieve. These are subject to change. The Alpha 5 cycle aims to bring Linux to parity (Alpha 4)with the other platforms. Note Report any issues you find using this guide. Linux examples: The Alpha 4 cycle aims to provide the The Note Report any issues you find using this guide. Test the Test the Review the table below and look for untested scenarios.
+Basically, try to break it and let us know if you find any issues! Go changes cause the application to be built twice Mac is partially working: The Alpha 3 cycle aims to provide bindings support. Wails 3 uses a new static analysis approach which allows us to provide
+a better bindings experience than in Wails 2.
+We also want to get all examples working on Linux. You can generate bindings using the The tests for the bindings generator can be found here with the test data located in the Review the table below and look for untested scenarios. The parser code and tests are located in Bindings for struct (CallByID): Bindings for struct (CallByName): Models: Examples: Alpha 2 aims to introduce Taskfile support. This will
+allow us to have a single, extensible build system that works on all platforms.
+We also want to get all examples working on Linux. Init & Build commands - Working Alpha 1 is the initial release. It is intended to get feedback on the new API
+and to get people experimenting with it. The main goal is to get most of the
+examples working on all platforms. Wails v3 Alpha moves from the v2's single-window, declarative API to a procedural one. This intuitive API makes code development easier, boosts readability, and unlocks complex multi-window apps. Wails v3 Alpha isn't just an improvement on past versions - it reimagines desktop application development capabilities with Go and modern web technologies. It's now possible to create multiple windows and configure each one
+independently. Systrays allow you to add an icon in the system tray area of your desktop and
+have the following features: Plugins allow you to extend the functionality of the Wails system. Not only can
+plugin methods be used in Go, but also called from Javascript. Included plugins: v3 uses a new static analyser to generate bindings. This makes it extremely fast
+and maintains comments and parameter names in your bindings. By default,
+bindings are generated with calls using IDs instead of strings. This provides a
+performance boost and allows for using obfuscation tools such as
+garble. Bindings are generated by simply running In v2, the build system was completely opaque and hard to customise. In v3, it's
+possible to build everything using standard Go tooling. All the heavy lifting that the v2 build system did, such as icon generation,
+have been added as tool commands in the CLI. We have incorporated
+Taskfile into the CLI to orchestrate these calls to
+bring the same developer experience as v2. However, this approach brings the
+ultimate balance of flexibility and ease of use as you can now customise the
+build process to your needs. You can even use make if that's your thing! Events are now emitted for a lot of the runtime operations, allowing you to hook
+into application/system events. Cross-platform (common) events are also emitted
+where there are common platform events, allowing you to write the same event
+handling methods cross platform. Event hooks can also be registered. These are like the An experimental feature to call runtime methods using plain html, similar to
+htmx. There are more examples available in the examples directory. Check them out!=q){if(s=W.limit_backward,W.limit_backward=q,W.ket=W.cursor,e=W.find_among_b(P,7))switch(W.bra=W.cursor,e){case 1:if(l()){if(i=W.limit-W.cursor,!W.eq_s_b(1,"s")&&(W.cursor=W.limit-i,!W.eq_s_b(1,"t")))break;W.slice_del()}break;case 2:W.slice_from("i");break;case 3:W.slice_del();break;case 4:W.eq_s_b(2,"gu")&&W.slice_del()}W.limit_backward=s}}function b(){var e=W.limit-W.cursor;W.find_among_b(U,5)&&(W.cursor=W.limit-e,W.ket=W.cursor,W.cursor>W.limit_backward&&(W.cursor--,W.bra=W.cursor,W.slice_del()))}function d(){for(var e,r=1;W.out_grouping_b(F,97,251);)r--;if(r<=0){if(W.ket=W.cursor,e=W.limit-W.cursor,!W.eq_s_b(1,"é")&&(W.cursor=W.limit-e,!W.eq_s_b(1,"è")))return;W.bra=W.cursor,W.slice_from("e")}}function k(){if(!w()&&(W.cursor=W.limit,!f()&&(W.cursor=W.limit,!m())))return W.cursor=W.limit,void _();W.cursor=W.limit,W.ket=W.cursor,W.eq_s_b(1,"Y")?(W.bra=W.cursor,W.slice_from("i")):(W.cursor=W.limit,W.eq_s_b(1,"ç")&&(W.bra=W.cursor,W.slice_from("c")))}var p,g,q,v=[new r("col",-1,-1),new r("par",-1,-1),new r("tap",-1,-1)],h=[new r("",-1,4),new r("I",0,1),new r("U",0,2),new r("Y",0,3)],z=[new r("iqU",-1,3),new r("abl",-1,3),new r("Ièr",-1,4),new r("ièr",-1,4),new r("eus",-1,2),new r("iv",-1,1)],y=[new r("ic",-1,2),new r("abil",-1,1),new r("iv",-1,3)],C=[new r("iqUe",-1,1),new r("atrice",-1,2),new r("ance",-1,1),new r("ence",-1,5),new r("logie",-1,3),new r("able",-1,1),new r("isme",-1,1),new r("euse",-1,11),new r("iste",-1,1),new r("ive",-1,8),new r("if",-1,8),new r("usion",-1,4),new r("ation",-1,2),new r("ution",-1,4),new r("ateur",-1,2),new r("iqUes",-1,1),new r("atrices",-1,2),new r("ances",-1,1),new r("ences",-1,5),new r("logies",-1,3),new r("ables",-1,1),new r("ismes",-1,1),new r("euses",-1,11),new r("istes",-1,1),new r("ives",-1,8),new r("ifs",-1,8),new r("usions",-1,4),new r("ations",-1,2),new r("utions",-1,4),new r("ateurs",-1,2),new r("ments",-1,15),new r("ements",30,6),new r("issements",31,12),new r("ités",-1,7),new r("ment",-1,15),new r("ement",34,6),new r("issement",35,12),new r("amment",34,13),new r("emment",34,14),new r("aux",-1,10),new r("eaux",39,9),new r("eux",-1,1),new r("ité",-1,7)],x=[new r("ira",-1,1),new r("ie",-1,1),new r("isse",-1,1),new r("issante",-1,1),new r("i",-1,1),new r("irai",4,1),new r("ir",-1,1),new r("iras",-1,1),new r("ies",-1,1),new r("îmes",-1,1),new r("isses",-1,1),new r("issantes",-1,1),new r("îtes",-1,1),new r("is",-1,1),new r("irais",13,1),new r("issais",13,1),new r("irions",-1,1),new r("issions",-1,1),new r("irons",-1,1),new r("issons",-1,1),new r("issants",-1,1),new r("it",-1,1),new r("irait",21,1),new r("issait",21,1),new r("issant",-1,1),new r("iraIent",-1,1),new r("issaIent",-1,1),new r("irent",-1,1),new r("issent",-1,1),new r("iront",-1,1),new r("ît",-1,1),new r("iriez",-1,1),new r("issiez",-1,1),new r("irez",-1,1),new r("issez",-1,1)],I=[new r("a",-1,3),new r("era",0,2),new r("asse",-1,3),new r("ante",-1,3),new r("ée",-1,2),new r("ai",-1,3),new r("erai",5,2),new r("er",-1,2),new r("as",-1,3),new r("eras",8,2),new r("âmes",-1,3),new r("asses",-1,3),new r("antes",-1,3),new r("âtes",-1,3),new r("ées",-1,2),new r("ais",-1,3),new r("erais",15,2),new r("ions",-1,1),new r("erions",17,2),new r("assions",17,3),new r("erons",-1,2),new r("ants",-1,3),new r("és",-1,2),new r("ait",-1,3),new r("erait",23,2),new r("ant",-1,3),new r("aIent",-1,3),new r("eraIent",26,2),new r("èrent",-1,2),new r("assent",-1,3),new r("eront",-1,2),new r("ât",-1,3),new r("ez",-1,2),new r("iez",32,2),new r("eriez",33,2),new r("assiez",33,3),new r("erez",32,2),new r("é",-1,2)],P=[new r("e",-1,3),new r("Ière",0,2),new r("ière",0,2),new r("ion",-1,1),new r("Ier",-1,2),new r("ier",-1,2),new r("ë",-1,4)],U=[new r("ell",-1,-1),new r("eill",-1,-1),new r("enn",-1,-1),new r("onn",-1,-1),new r("ett",-1,-1)],F=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,128,130,103,8,5],S=[1,65,20,0,0,0,0,0,0,0,0,0,0,0,0,0,128],W=new s;this.setCurrent=function(e){W.setCurrent(e)},this.getCurrent=function(){return W.getCurrent()},this.stem=function(){var e=W.cursor;return n(),W.cursor=e,u(),W.limit_backward=e,W.cursor=W.limit,k(),W.cursor=W.limit,b(),W.cursor=W.limit,d(),W.cursor=W.limit_backward,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.fr.stemmer,"stemmer-fr"),e.fr.stopWordFilter=e.generateStopWordFilter("ai aie aient aies ait as au aura aurai auraient aurais aurait auras aurez auriez aurions aurons auront aux avaient avais avait avec avez aviez avions avons ayant ayez ayons c ce ceci celà ces cet cette d dans de des du elle en es est et eu eue eues eurent eus eusse eussent eusses eussiez eussions eut eux eûmes eût eûtes furent fus fusse fussent fusses fussiez fussions fut fûmes fût fûtes ici il ils j je l la le les leur leurs lui m ma mais me mes moi mon même n ne nos notre nous on ont ou par pas pour qu que quel quelle quelles quels qui s sa sans se sera serai seraient serais serait seras serez seriez serions serons seront ses soi soient sois soit sommes son sont soyez soyons suis sur t ta te tes toi ton tu un une vos votre vous y à étaient étais était étant étiez étions été étée étées étés êtes".split(" ")),e.Pipeline.registerFunction(e.fr.stopWordFilter,"stopWordFilter-fr")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.he.min.js b/assets/javascripts/lunr/min/lunr.he.min.js
new file mode 100644
index 00000000..b863d3ea
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.he.min.js
@@ -0,0 +1 @@
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.he=function(){this.pipeline.reset(),this.pipeline.add(e.he.trimmer,e.he.stopWordFilter,e.he.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.he.stemmer))},e.he.wordCharacters="֑-״א-תa-zA-Za-zA-Z0-90-9",e.he.trimmer=e.trimmerSupport.generateTrimmer(e.he.wordCharacters),e.Pipeline.registerFunction(e.he.trimmer,"trimmer-he"),e.he.stemmer=function(){var e=this;return e.result=!1,e.preRemoved=!1,e.sufRemoved=!1,e.pre={pre1:"ה ו י ת",pre2:"ב כ ל מ ש כש",pre3:"הב הכ הל המ הש בש לכ",pre4:"וב וכ ול ומ וש",pre5:"מה שה כל",pre6:"מב מכ מל ממ מש",pre7:"בה בו בי בת כה כו כי כת לה לו לי לת",pre8:"ובה ובו ובי ובת וכה וכו וכי וכת ולה ולו ולי ולת"},e.suf={suf1:"ך כ ם ן נ",suf2:"ים ות וך וכ ום ון ונ הם הן יכ יך ינ ים",suf3:"תי תך תכ תם תן תנ",suf4:"ותי ותך ותכ ותם ותן ותנ",suf5:"נו כם כן הם הן",suf6:"ונו וכם וכן והם והן",suf7:"תכם תכן תנו תהם תהן",suf8:"הוא היא הם הן אני אתה את אנו אתם אתן",suf9:"ני נו כי כו כם כן תי תך תכ תם תן",suf10:"י ך כ ם ן נ ת"},e.patterns=JSON.parse('{"hebrewPatterns": [{"pt1": [{"c": "ה", "l": 0}]}, {"pt2": [{"c": "ו", "l": 0}]}, {"pt3": [{"c": "י", "l": 0}]}, {"pt4": [{"c": "ת", "l": 0}]}, {"pt5": [{"c": "מ", "l": 0}]}, {"pt6": [{"c": "ל", "l": 0}]}, {"pt7": [{"c": "ב", "l": 0}]}, {"pt8": [{"c": "כ", "l": 0}]}, {"pt9": [{"c": "ש", "l": 0}]}, {"pt10": [{"c": "כש", "l": 0}]}, {"pt11": [{"c": "בה", "l": 0}]}, {"pt12": [{"c": "וב", "l": 0}]}, {"pt13": [{"c": "וכ", "l": 0}]}, {"pt14": [{"c": "ול", "l": 0}]}, {"pt15": [{"c": "ומ", "l": 0}]}, {"pt16": [{"c": "וש", "l": 0}]}, {"pt17": [{"c": "הב", "l": 0}]}, {"pt18": [{"c": "הכ", "l": 0}]}, {"pt19": [{"c": "הל", "l": 0}]}, {"pt20": [{"c": "המ", "l": 0}]}, {"pt21": [{"c": "הש", "l": 0}]}, {"pt22": [{"c": "מה", "l": 0}]}, {"pt23": [{"c": "שה", "l": 0}]}, {"pt24": [{"c": "כל", "l": 0}]}]}'),e.execArray=["cleanWord","removeDiacritics","removeStopWords","normalizeHebrewCharacters"],e.stem=function(){var r=0;for(e.result=!1,e.preRemoved=!1,e.sufRemoved=!1;r
=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(m,29),w.limit_backward=r,e))switch(w.bra=w.cursor,e){case 1:w.slice_del();break;case 2:n=w.limit-w.cursor,w.in_grouping_b(c,98,122)?w.slice_del():(w.cursor=w.limit-n,w.eq_s_b(1,"k")&&w.out_grouping_b(d,97,248)&&w.slice_del());break;case 3:w.slice_from("er")}}function t(){var e,r=w.limit-w.cursor;w.cursor>=a&&(e=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,w.find_among_b(u,2)?(w.bra=w.cursor,w.limit_backward=e,w.cursor=w.limit-r,w.cursor>w.limit_backward&&(w.cursor--,w.bra=w.cursor,w.slice_del())):w.limit_backward=e)}function o(){var e,r;w.cursor>=a&&(r=w.limit_backward,w.limit_backward=a,w.ket=w.cursor,e=w.find_among_b(l,11),e?(w.bra=w.cursor,w.limit_backward=r,1==e&&w.slice_del()):w.limit_backward=r)}var s,a,m=[new r("a",-1,1),new r("e",-1,1),new r("ede",1,1),new r("ande",1,1),new r("ende",1,1),new r("ane",1,1),new r("ene",1,1),new r("hetene",6,1),new r("erte",1,3),new r("en",-1,1),new r("heten",9,1),new r("ar",-1,1),new r("er",-1,1),new r("heter",12,1),new r("s",-1,2),new r("as",14,1),new r("es",14,1),new r("edes",16,1),new r("endes",16,1),new r("enes",16,1),new r("hetenes",19,1),new r("ens",14,1),new r("hetens",21,1),new r("ers",14,1),new r("ets",14,1),new r("et",-1,1),new r("het",25,1),new r("ert",-1,3),new r("ast",-1,1)],u=[new r("dt",-1,-1),new r("vt",-1,-1)],l=[new r("leg",-1,1),new r("eleg",0,1),new r("ig",-1,1),new r("eig",2,1),new r("lig",2,1),new r("elig",4,1),new r("els",-1,1),new r("lov",-1,1),new r("elov",7,1),new r("slov",7,1),new r("hetslov",9,1)],d=[17,65,16,1,0,0,0,0,0,0,0,0,0,0,0,0,48,0,128],c=[119,125,149,1],w=new n;this.setCurrent=function(e){w.setCurrent(e)},this.getCurrent=function(){return w.getCurrent()},this.stem=function(){var r=w.cursor;return e(),w.limit_backward=r,w.cursor=w.limit,i(),w.cursor=w.limit,t(),w.cursor=w.limit,o(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return i.setCurrent(e),i.stem(),i.getCurrent()}):(i.setCurrent(e),i.stem(),i.getCurrent())}}(),e.Pipeline.registerFunction(e.no.stemmer,"stemmer-no"),e.no.stopWordFilter=e.generateStopWordFilter("alle at av bare begge ble blei bli blir blitt både båe da de deg dei deim deira deires dem den denne der dere deres det dette di din disse ditt du dykk dykkar då eg ein eit eitt eller elles en enn er et ett etter for fordi fra før ha hadde han hans har hennar henne hennes her hjå ho hoe honom hoss hossen hun hva hvem hver hvilke hvilken hvis hvor hvordan hvorfor i ikke ikkje ikkje ingen ingi inkje inn inni ja jeg kan kom korleis korso kun kunne kva kvar kvarhelst kven kvi kvifor man mange me med medan meg meget mellom men mi min mine mitt mot mykje ned no noe noen noka noko nokon nokor nokre nå når og også om opp oss over på samme seg selv si si sia sidan siden sin sine sitt sjøl skal skulle slik so som som somme somt så sånn til um upp ut uten var vart varte ved vere verte vi vil ville vore vors vort vår være være vært å".split(" ")),e.Pipeline.registerFunction(e.no.stopWordFilter,"stopWordFilter-no")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.pt.min.js b/assets/javascripts/lunr/min/lunr.pt.min.js
new file mode 100644
index 00000000..6c16996d
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.pt.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Portuguese` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,r){"function"==typeof define&&define.amd?define(r):"object"==typeof exports?module.exports=r():r()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.pt=function(){this.pipeline.reset(),this.pipeline.add(e.pt.trimmer,e.pt.stopWordFilter,e.pt.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.pt.stemmer))},e.pt.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.pt.trimmer=e.trimmerSupport.generateTrimmer(e.pt.wordCharacters),e.Pipeline.registerFunction(e.pt.trimmer,"trimmer-pt"),e.pt.stemmer=function(){var r=e.stemmerSupport.Among,s=e.stemmerSupport.SnowballProgram,n=new function(){function e(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(k,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("a~");continue;case 2:z.slice_from("o~");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function n(){if(z.out_grouping(y,97,250)){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!0;z.cursor++}return!1}return!0}function i(){if(z.in_grouping(y,97,250))for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return g=z.cursor,!0}function o(){var e,r,s=z.cursor;if(z.in_grouping(y,97,250))if(e=z.cursor,n()){if(z.cursor=e,i())return}else g=z.cursor;if(z.cursor=s,z.out_grouping(y,97,250)){if(r=z.cursor,n()){if(z.cursor=r,!z.in_grouping(y,97,250)||z.cursor>=z.limit)return;z.cursor++}g=z.cursor}}function t(){for(;!z.in_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}for(;!z.out_grouping(y,97,250);){if(z.cursor>=z.limit)return!1;z.cursor++}return!0}function a(){var e=z.cursor;g=z.limit,b=g,h=g,o(),z.cursor=e,t()&&(b=z.cursor,t()&&(h=z.cursor))}function u(){for(var e;;){if(z.bra=z.cursor,e=z.find_among(q,3))switch(z.ket=z.cursor,e){case 1:z.slice_from("ã");continue;case 2:z.slice_from("õ");continue;case 3:if(z.cursor>=z.limit)break;z.cursor++;continue}break}}function w(){return g<=z.cursor}function m(){return b<=z.cursor}function c(){return h<=z.cursor}function l(){var e;if(z.ket=z.cursor,!(e=z.find_among_b(F,45)))return!1;switch(z.bra=z.cursor,e){case 1:if(!c())return!1;z.slice_del();break;case 2:if(!c())return!1;z.slice_from("log");break;case 3:if(!c())return!1;z.slice_from("u");break;case 4:if(!c())return!1;z.slice_from("ente");break;case 5:if(!m())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(j,4),e&&(z.bra=z.cursor,c()&&(z.slice_del(),1==e&&(z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del()))));break;case 6:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(C,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 7:if(!c())return!1;z.slice_del(),z.ket=z.cursor,e=z.find_among_b(P,3),e&&(z.bra=z.cursor,1==e&&c()&&z.slice_del());break;case 8:if(!c())return!1;z.slice_del(),z.ket=z.cursor,z.eq_s_b(2,"at")&&(z.bra=z.cursor,c()&&z.slice_del());break;case 9:if(!w()||!z.eq_s_b(1,"e"))return!1;z.slice_from("ir")}return!0}function f(){var e,r;if(z.cursor>=g){if(r=z.limit_backward,z.limit_backward=g,z.ket=z.cursor,e=z.find_among_b(S,120))return z.bra=z.cursor,1==e&&z.slice_del(),z.limit_backward=r,!0;z.limit_backward=r}return!1}function d(){var e;z.ket=z.cursor,(e=z.find_among_b(W,7))&&(z.bra=z.cursor,1==e&&w()&&z.slice_del())}function v(e,r){if(z.eq_s_b(1,e)){z.bra=z.cursor;var s=z.limit-z.cursor;if(z.eq_s_b(1,r))return z.cursor=z.limit-s,w()&&z.slice_del(),!1}return!0}function p(){var e;if(z.ket=z.cursor,e=z.find_among_b(L,4))switch(z.bra=z.cursor,e){case 1:w()&&(z.slice_del(),z.ket=z.cursor,z.limit-z.cursor,v("u","g")&&v("i","c"));break;case 2:z.slice_from("c")}}function _(){if(!l()&&(z.cursor=z.limit,!f()))return z.cursor=z.limit,void d();z.cursor=z.limit,z.ket=z.cursor,z.eq_s_b(1,"i")&&(z.bra=z.cursor,z.eq_s_b(1,"c")&&(z.cursor=z.limit,w()&&z.slice_del()))}var h,b,g,k=[new r("",-1,3),new r("ã",0,1),new r("õ",0,2)],q=[new r("",-1,3),new r("a~",0,1),new r("o~",0,2)],j=[new r("ic",-1,-1),new r("ad",-1,-1),new r("os",-1,-1),new r("iv",-1,1)],C=[new r("ante",-1,1),new r("avel",-1,1),new r("ível",-1,1)],P=[new r("ic",-1,1),new r("abil",-1,1),new r("iv",-1,1)],F=[new r("ica",-1,1),new r("ância",-1,1),new r("ência",-1,4),new r("ira",-1,9),new r("adora",-1,1),new r("osa",-1,1),new r("ista",-1,1),new r("iva",-1,8),new r("eza",-1,1),new r("logía",-1,2),new r("idade",-1,7),new r("ante",-1,1),new r("mente",-1,6),new r("amente",12,5),new r("ável",-1,1),new r("ível",-1,1),new r("ución",-1,3),new r("ico",-1,1),new r("ismo",-1,1),new r("oso",-1,1),new r("amento",-1,1),new r("imento",-1,1),new r("ivo",-1,8),new r("aça~o",-1,1),new r("ador",-1,1),new r("icas",-1,1),new r("ências",-1,4),new r("iras",-1,9),new r("adoras",-1,1),new r("osas",-1,1),new r("istas",-1,1),new r("ivas",-1,8),new r("ezas",-1,1),new r("logías",-1,2),new r("idades",-1,7),new r("uciones",-1,3),new r("adores",-1,1),new r("antes",-1,1),new r("aço~es",-1,1),new r("icos",-1,1),new r("ismos",-1,1),new r("osos",-1,1),new r("amentos",-1,1),new r("imentos",-1,1),new r("ivos",-1,8)],S=[new r("ada",-1,1),new r("ida",-1,1),new r("ia",-1,1),new r("aria",2,1),new r("eria",2,1),new r("iria",2,1),new r("ara",-1,1),new r("era",-1,1),new r("ira",-1,1),new r("ava",-1,1),new r("asse",-1,1),new r("esse",-1,1),new r("isse",-1,1),new r("aste",-1,1),new r("este",-1,1),new r("iste",-1,1),new r("ei",-1,1),new r("arei",16,1),new r("erei",16,1),new r("irei",16,1),new r("am",-1,1),new r("iam",20,1),new r("ariam",21,1),new r("eriam",21,1),new r("iriam",21,1),new r("aram",20,1),new r("eram",20,1),new r("iram",20,1),new r("avam",20,1),new r("em",-1,1),new r("arem",29,1),new r("erem",29,1),new r("irem",29,1),new r("assem",29,1),new r("essem",29,1),new r("issem",29,1),new r("ado",-1,1),new r("ido",-1,1),new r("ando",-1,1),new r("endo",-1,1),new r("indo",-1,1),new r("ara~o",-1,1),new r("era~o",-1,1),new r("ira~o",-1,1),new r("ar",-1,1),new r("er",-1,1),new r("ir",-1,1),new r("as",-1,1),new r("adas",47,1),new r("idas",47,1),new r("ias",47,1),new r("arias",50,1),new r("erias",50,1),new r("irias",50,1),new r("aras",47,1),new r("eras",47,1),new r("iras",47,1),new r("avas",47,1),new r("es",-1,1),new r("ardes",58,1),new r("erdes",58,1),new r("irdes",58,1),new r("ares",58,1),new r("eres",58,1),new r("ires",58,1),new r("asses",58,1),new r("esses",58,1),new r("isses",58,1),new r("astes",58,1),new r("estes",58,1),new r("istes",58,1),new r("is",-1,1),new r("ais",71,1),new r("eis",71,1),new r("areis",73,1),new r("ereis",73,1),new r("ireis",73,1),new r("áreis",73,1),new r("éreis",73,1),new r("íreis",73,1),new r("ásseis",73,1),new r("ésseis",73,1),new r("ísseis",73,1),new r("áveis",73,1),new r("íeis",73,1),new r("aríeis",84,1),new r("eríeis",84,1),new r("iríeis",84,1),new r("ados",-1,1),new r("idos",-1,1),new r("amos",-1,1),new r("áramos",90,1),new r("éramos",90,1),new r("íramos",90,1),new r("ávamos",90,1),new r("íamos",90,1),new r("aríamos",95,1),new r("eríamos",95,1),new r("iríamos",95,1),new r("emos",-1,1),new r("aremos",99,1),new r("eremos",99,1),new r("iremos",99,1),new r("ássemos",99,1),new r("êssemos",99,1),new r("íssemos",99,1),new r("imos",-1,1),new r("armos",-1,1),new r("ermos",-1,1),new r("irmos",-1,1),new r("ámos",-1,1),new r("arás",-1,1),new r("erás",-1,1),new r("irás",-1,1),new r("eu",-1,1),new r("iu",-1,1),new r("ou",-1,1),new r("ará",-1,1),new r("erá",-1,1),new r("irá",-1,1)],W=[new r("a",-1,1),new r("i",-1,1),new r("o",-1,1),new r("os",-1,1),new r("á",-1,1),new r("í",-1,1),new r("ó",-1,1)],L=[new r("e",-1,1),new r("ç",-1,2),new r("é",-1,1),new r("ê",-1,1)],y=[17,65,16,0,0,0,0,0,0,0,0,0,0,0,0,0,3,19,12,2],z=new s;this.setCurrent=function(e){z.setCurrent(e)},this.getCurrent=function(){return z.getCurrent()},this.stem=function(){var r=z.cursor;return e(),z.cursor=r,a(),z.limit_backward=r,z.cursor=z.limit,_(),z.cursor=z.limit,p(),z.cursor=z.limit_backward,u(),!0}};return function(e){return"function"==typeof e.update?e.update(function(e){return n.setCurrent(e),n.stem(),n.getCurrent()}):(n.setCurrent(e),n.stem(),n.getCurrent())}}(),e.Pipeline.registerFunction(e.pt.stemmer,"stemmer-pt"),e.pt.stopWordFilter=e.generateStopWordFilter("a ao aos aquela aquelas aquele aqueles aquilo as até com como da das de dela delas dele deles depois do dos e ela elas ele eles em entre era eram essa essas esse esses esta estamos estas estava estavam este esteja estejam estejamos estes esteve estive estivemos estiver estivera estiveram estiverem estivermos estivesse estivessem estivéramos estivéssemos estou está estávamos estão eu foi fomos for fora foram forem formos fosse fossem fui fôramos fôssemos haja hajam hajamos havemos hei houve houvemos houver houvera houveram houverei houverem houveremos houveria houveriam houvermos houverá houverão houveríamos houvesse houvessem houvéramos houvéssemos há hão isso isto já lhe lhes mais mas me mesmo meu meus minha minhas muito na nas nem no nos nossa nossas nosso nossos num numa não nós o os ou para pela pelas pelo pelos por qual quando que quem se seja sejam sejamos sem serei seremos seria seriam será serão seríamos seu seus somos sou sua suas são só também te tem temos tenha tenham tenhamos tenho terei teremos teria teriam terá terão teríamos teu teus teve tinha tinham tive tivemos tiver tivera tiveram tiverem tivermos tivesse tivessem tivéramos tivéssemos tu tua tuas tém tínhamos um uma você vocês vos à às éramos".split(" ")),e.Pipeline.registerFunction(e.pt.stopWordFilter,"stopWordFilter-pt")}});
\ No newline at end of file
diff --git a/assets/javascripts/lunr/min/lunr.ro.min.js b/assets/javascripts/lunr/min/lunr.ro.min.js
new file mode 100644
index 00000000..72771401
--- /dev/null
+++ b/assets/javascripts/lunr/min/lunr.ro.min.js
@@ -0,0 +1,18 @@
+/*!
+ * Lunr languages, `Romanian` language
+ * https://github.com/MihaiValentin/lunr-languages
+ *
+ * Copyright 2014, Mihai Valentin
+ * http://www.mozilla.org/MPL/
+ */
+/*!
+ * based on
+ * Snowball JavaScript Library v0.3
+ * http://code.google.com/p/urim/
+ * http://snowball.tartarus.org/
+ *
+ * Copyright 2010, Oleg Mazko
+ * http://www.mozilla.org/MPL/
+ */
+
+!function(e,i){"function"==typeof define&&define.amd?define(i):"object"==typeof exports?module.exports=i():i()(e.lunr)}(this,function(){return function(e){if(void 0===e)throw new Error("Lunr is not present. Please include / require Lunr before this script.");if(void 0===e.stemmerSupport)throw new Error("Lunr stemmer support is not present. Please include / require Lunr stemmer support before this script.");e.ro=function(){this.pipeline.reset(),this.pipeline.add(e.ro.trimmer,e.ro.stopWordFilter,e.ro.stemmer),this.searchPipeline&&(this.searchPipeline.reset(),this.searchPipeline.add(e.ro.stemmer))},e.ro.wordCharacters="A-Za-zªºÀ-ÖØ-öø-ʸˠ-ˤᴀ-ᴥᴬ-ᵜᵢ-ᵥᵫ-ᵷᵹ-ᶾḀ-ỿⁱⁿₐ-ₜKÅℲⅎⅠ-ↈⱠ-ⱿꜢ-ꞇꞋ-ꞭꞰ-ꞷꟷ-ꟿꬰ-ꭚꭜ-ꭤff-stA-Za-z",e.ro.trimmer=e.trimmerSupport.generateTrimmer(e.ro.wordCharacters),e.Pipeline.registerFunction(e.ro.trimmer,"trimmer-ro"),e.ro.stemmer=function(){var i=e.stemmerSupport.Among,r=e.stemmerSupport.SnowballProgram,n=new function(){function e(e,i){L.eq_s(1,e)&&(L.ket=L.cursor,L.in_grouping(W,97,259)&&L.slice_from(i))}function n(){for(var i,r;;){if(i=L.cursor,L.in_grouping(W,97,259)&&(r=L.cursor,L.bra=r,e("u","U"),L.cursor=r,e("i","I")),L.cursor=i,L.cursor>=L.limit)break;L.cursor++}}function t(){if(L.out_grouping(W,97,259)){for(;!L.in_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}return!0}function a(){if(L.in_grouping(W,97,259))for(;!L.out_grouping(W,97,259);){if(L.cursor>=L.limit)return!0;L.cursor++}return!1}function o(){var e,i,r=L.cursor;if(L.in_grouping(W,97,259)){if(e=L.cursor,!t())return void(h=L.cursor);if(L.cursor=e,!a())return void(h=L.cursor)}L.cursor=r,L.out_grouping(W,97,259)&&(i=L.cursor,t()&&(L.cursor=i,L.in_grouping(W,97,259)&&L.cursor=e;r--){var n=this.uncheckedNodes[r],i=n.child.toString();i in this.minimizedNodes?n.parent.edges[n.char]=this.minimizedNodes[i]:(n.child._str=i,this.minimizedNodes[i]=n.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(r){var n=new t.QueryParser(e,r);n.parse()})},t.Index.prototype.query=function(e){for(var r=new t.Query(this.fields),n=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),u=0;u
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changelog#
+
+
+[Unreleased]#
+Added#
+
+
+run:linux by @marcus-crane in #3146SetIcon method by @almas1992 in PROnShutdown by @almas1992 in PRToggleMaximise method in Window interface by @fbbdev in #3281Environment(). By @leaanthony in aba82cc based on PR by @Mai-LapystWebviewWindow.IsFocused method on the Window interface by @fbbdev in #3295setIcon on linux by @abichinger in #3354-port to dev command and support environment variable WAILS_VITE_PORT by @abichinger in #3429Fixed#
+
+
+go.mod to use relative paths. Fixes Windows paths with spaces - @leaanthony.WebviewWindow.Restore method by @fbbdev in #3279startURL across multiple GetStartURL invocations when FRONTEND_DEVSERVER_URL is present. #3299Screen struct to match its Go counterpart by @fbbdev in #3295WML.Reload method to ensure proper cleanup of registered event listeners by @fbbdev in #3295wails3 task dev by @hfoxy in #3417Changed#
+
+
+type="module" attribute. By @fbbdev in #3295@wailsio/runtime package does not publish its API on the window.wails object, and does not start the WML system. This has been done to improve encapsulation. The WML system can be started manually if desired by calling the new WML.Enable method. The bundled JS runtime script still performs both operations automatically. By @fbbdev in #3295@wailsio/runtime/src/window now exposes the containing window object as a default export. It is not possible anymore to import individual methods through ESM named or namespace import syntax.WebviewWindow API. Some methods have changed name or prototype, specifically: Screen becomes GetScreen; GetZoomLevel/SetZoomLevel become GetZoom/SetZoom; GetZoom, Width and Height now return values directly instead of wrapping them within objects. By @fbbdev in #3295Removed#
+Deprecated#
+Security#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cais#
+Newydd#
+New(appOptions Options) *AppNew(appOptions Options) yn creu cais newydd gan ddefnyddio'r opsiynau cais a ddarperir. Mae'n cymhwyso gwerthoedd rhagosodedig ar gyfer opsiynau heb eu pennu, yn eu cyfuno â'r rhai a ddarparwyd, yn eu cychwyn a'n dychwelyd enghraifft o'r cais.package main
+
+import "github.com/wailsapp/wails/v3/pkg/application"
+
+func main() {
+ app := application.New(application.Options{
+ Name: "Demo Ffenestr Gweddarlunydd",
+ // Opsiynau eraill
+ })
+
+ // Gweddill y cais
+}
+Cael#
+Get() yn dychwelyd yr enghraifft gyffredinol o'r cais. Mae'n ddefnyddiol pan fydd angen mynediad i'r cais o wahanol rannau o'ch cod.Galluoedd#
+Capabilities() capabilities.CapabilitiesCapabilities() yn adfer map o'r galluoedd sydd gan y cais ar hyn o bryd. Gall y galluoedd fod ynghylch y nodweddion gwahanol y system weithredu sy'n darparu, fel nodweddion gweddarlunydd. // Cael galluoedd y cais
+ capabilities := app.Capabilities()
+ if capabilities.HasNativeDrag {
+ // Gwneud rhywbeth
+ }
+GetPID#
+GetPID() intGetPID() yn dychwelyd ID y Broses y cais.Rhedeg#
+Run() errorRun() yn dechrau gweithredu'r cais a'i gydrannau. app := application.New(application.Options{
+ //options
+ })
+ // Rhedeg y cais
+ err := application.Run()
+ if err != nil {
+ // Ymdrin â'r gwall
+ }
+Gadael#
+Quit()Quit() yn gadael y cais trwy ddinistrio ffenestri a rhai cydrannau eraill o bosibl.AydunDdyryslyd#
+IsDarkMode() boolIsDarkMode() yn gwirio a yw'r cais yn rhedeg mewn modd tywyll. Mae'n dychwelyd gwerth boolean yn nodi a yw'r modd tywyll wedi'i alluogi.Cuddio#
+Hide()Hide() yn cuddio ffenestr y cais.Dangos#
+Show()Show() yn dangos ffenestr y cais.NewWebviewWindow#
+NewWebviewWindow() *WebviewWindowNewWebviewWindow() yn creu ffenestr Webview newydd gyda'r opsiynau rhagosodedig, ac yn ei dychwelyd.NewWebviewWindowWithOptions#
+NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindowNewWebviewWindowWithOptions() yn creu ffenestr webview newydd gydag opsiynau custom. Caiff y ffenestr newydd ei ychwanegu at fap o ffenestri a reolir gan y cymhwysiad. // Creu ffenestr webview newydd gydag opsiynau custom
+ window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
+ Name: "Main",
+ Title: "Fy Ffenestr",
+ Width: 800,
+ Height: 600,
+ })
+OnWindowCreation#
+OnWindowCreation(callback func(window *WebviewWindow))OnWindowCreation() yn cofrestru ffwythiant alw-nôl i'w alw pan grëir ffenestr. // Cofrestru ffwythiant alw-nôl i'w alw pan grëir ffenestr
+ app.OnWindowCreation(func(window *WebviewWindow) {
+ // Gwneud rhywbeth
+ })
+GetWindowByName#
+GetWindowByName(name string) *WebviewWindowGetWindowByName() yn nôl ac yn dychwelyd ffenestr gyda enw penodol.CurrentWindow#
+CurrentWindow() *WebviewWindowCurrentWindow() yn nôl ac yn dychwelyd cyfeiriad at y ffenestr weithredol yn y cymhwysiad. Os nad oes ffenestr, mae'n dychwelyd nil.RegisterContextMenu#
+RegisterContextMenu(name string, menu *Menu)RegisterContextMenu() yn cofrestru dewislen cyd-destun gyda enw penodol. Gellir defnyddio'r dewislen hon yn ddiweddarach yn yr ap. // Creu dewislen newydd
+ ctxmenu := app.NewMenu()
+
+ // Cofrestru'r dewislen fel dewislen cyd-destun
+ app.RegisterContextMenu("MyContextMenu", ctxmenu)
+SetMenu#
+SetMenu(menu *Menu)SetMenu() yn gosod y ddewislen ar gyfer yr ap. Ar Mac, bydd hyn yn fod y ddewislen fyd-eang. Ar gyfer Windows a Linux, bydd hyn yn fod y ddewislen ddiofyn ar gyfer unrhyw ffenestr newydd a grëir. // Creu dewislen newydd
+ menu := app.NewMenu()
+
+ // Gosod y ddewislen ar gyfer yr ap
+ app.SetMenu(menu)
+Dangos Deialog Ynghylch#
+ShowAboutDialog()ShowAboutDialog() yn dangos blwch deialog "Ynghylch". Gall ddangos enw'r
+cymhwysiad, disgrifiad ac eicon.Gwybodaeth#
+InfoDialog()InfoDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog gyda
+InfoDialogType. Defnyddir y deialog hon fel arfer i ddangos negeseuon
+gwybodaeth i'r defnyddiwr.Cwestiwn#
+QuestionDialog()QuestionDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog
+gyda QuestionDialogType. Defnyddir y deialog hon yn aml i ofyn cwestiwn i'r
+defnyddiwr a disgwyl ymateb.Rhybudd#
+WarningDialog()WarningDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog
+gyda WarningDialogType. Fel y mae'r enw yn awgrymu, defnyddir y deialog hon yn
+bennaf i ddangos negeseuon rhybudd i'r defnyddiwr.Gwall#
+ErrorDialog()ErrorDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog gyda
+ErrorDialogType. Cynlluniwyd y deialog hon i'w defnyddio pan fydd angen
+dangos neges gwall i'r defnyddiwr.Agor Ffeil#
+OpenFileDialog()OpenFileDialog() yn creu ac yn dychwelyd esiampl newydd o
+OpenFileDialogStruct. Mae'r deialog hon yn annog y defnyddiwr i ddewis un neu
+ragor o ffeiliau o'u system ffeiliau.Cadw Ffeil#
+SaveFileDialog()SaveFileDialog() yn creu ac yn dychwelyd esiampl newydd o
+SaveFileDialogStruct. Mae'r deialog hon yn annog y defnyddiwr i ddewis lleoliad
+yn eu system ffeiliau lle y dylid cadw ffeil.Agor Cyfeiriadur#
+OpenDirectoryDialog()OpenDirectoryDialog() yn creu ac yn dychwelyd esiampl newydd o
+MessageDialog gyda OpenDirectoryDialogType. Mae'r deialog hon yn galluogi'r
+defnyddiwr i ddewis cyfeiriadur o'u system ffeiliau.Ar#
+Ar(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()Ar() yn cofrestru gwrandäwr digwyddiad ar gyfer digwyddiadau cymhwysiad penodol. Bydd y swyddogaeth atebydd a ddarperir yn cael ei sbarduno pan fydd y digwyddiad cysylltiedig yn digwydd. Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r gwrandäwr.CofrestruArgraffwyr#
+CofrestruArgraffwyr(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()CofrestruArgraffwyr() yn cofrestru atebydd i'w redeg fel crocen yn ystod digwyddiadau penodol. Caiff y crocenau hyn eu rhedeg cyn gwrandawyr sy'n gysylltiedig ag Ar(). Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r bâs.GetPrimaryScreen#
+GetPrimaryScreen() (*Sgrin, error)GetPrimaryScreen() yn dychwelyd y sgrin brif y system.GetScreens#
+GetScreens() ([]*Sgrin, error)GetScreens() yn dychwelyd gwybodaeth am bob sgrin sydd wedi'i chysylltu â'r system.App strwythur a ddarparwyd. Cofiwch, ar gyfer mwy o swyddogaethau neu ystyriaethau manwl, cyfeiriwch at y cod Go gwirioneddol neu ddogfennaeth fewnol bellach.Opsiynau#
+package application
+
+import (
+ "io/fs"
+ "log/slog"
+ "net/http"
+
+ "github.com/wailsapp/wails/v3/internal/assetserver"
+)
+
+// Options contains the options for the application
+type Options struct {
+ // Name is the name of the application (used in the default about box)
+ Name string
+
+ // Description is the description of the application (used in the default about box)
+ Description string
+
+ // Icon is the icon of the application (used in the default about box)
+ Icon []byte
+
+ // Mac is the Mac specific configuration for Mac builds
+ Mac MacOptions
+
+ // Windows is the Windows specific configuration for Windows builds
+ Windows WindowsOptions
+
+ // Linux is the Linux specific configuration for Linux builds
+ Linux LinuxOptions
+
+ // Bind allows you to bind Go methods to the frontend.
+ Bind []any
+
+ // BindAliases allows you to specify alias IDs for your bound methods.
+ // Example: `BindAliases: map[uint32]uint32{1: 1411160069}` states that alias ID 1 maps to the Go method with ID 1411160069.
+ BindAliases map[uint32]uint32
+
+ // Logger i a slog.Logger instance used for logging Wails system messages (not application messages).
+ // If not defined, a default logger is used.
+ Logger *slog.Logger
+
+ // LogLevel defines the log level of the Wails system logger.
+ LogLevel slog.Level
+
+ // Assets are the application assets to be used.
+ Assets AssetOptions
+
+ // Plugins is a map of plugins used by the application
+ Plugins map[string]Plugin
+
+ // Flags are key value pairs that are available to the frontend.
+ // This is also used by Wails to provide information to the frontend.
+ Flags map[string]any
+
+ // PanicHandler is called when a panic occurs
+ PanicHandler func(any)
+
+ // DisableDefaultSignalHandler disables the default signal handler
+ DisableDefaultSignalHandler bool
+
+ // KeyBindings is a map of key bindings to functions
+ KeyBindings map[string]func(window *WebviewWindow)
+
+ // OnShutdown is called when the application is about to terminate.
+ // This is useful for cleanup tasks.
+ // The shutdown process blocks until this function returns
+ OnShutdown func()
+
+ // ShouldQuit is a function that is called when the user tries to quit the application.
+ // If the function returns true, the application will quit.
+ // If the function returns false, the application will not quit.
+ ShouldQuit func() bool
+}
+
+// AssetOptions defines the configuration of the AssetServer.
+type AssetOptions struct {
+ // Handler which serves all the content to the WebView.
+ 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.
+ //
+ // This middleware injects itself before any of Wails internal middlewares.
+ //
+ // If not defined, the default AssetServer request chain is executed.
+ //
+ // Multiple Middlewares can be chained together with:
+ // ChainMiddleware(middleware ...Middleware) Middleware
+ Middleware Middleware
+
+ // DisableLogging disables logging of the AssetServer. By default, the AssetServer logs every request.
+ DisableLogging bool
+}
+
+// Middleware defines 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.
+type Middleware func(next http.Handler) http.Handler
+
+// ChainMiddleware allows chaining multiple middlewares to one middleware.
+func ChainMiddleware(middleware ...Middleware) Middleware {
+ return func(h http.Handler) http.Handler {
+ for i := len(middleware) - 1; i >= 0; i-- {
+ h = middleware[i](h)
+ }
+ return h
+ }
+}
+
+// AssetFileServerFS returns a http handler which serves the assets from the fs.FS.
+// If an external devserver has been provided 'FRONTEND_DEVSERVER_URL' the files are being served
+// from the external server, ignoring the `assets`.
+func AssetFileServerFS(assets fs.FS) http.Handler {
+ return assetserver.NewAssetFileServer(assets)
+}
+
+// BundledAssetFileServer returns a http handler which serves the assets from the fs.FS.
+// If an external devserver has been provided 'FRONTEND_DEVSERVER_URL' the files are being served
+// from the external server, ignoring the `assets`.
+// It also serves the compiled runtime.js file at `/wails/runtime.js`.
+// It will provide the production runtime.js file from the embedded assets if the `production` tag is used.
+func BundledAssetFileServer(assets fs.FS) http.Handler {
+ return assetserver.NewBundledAssetFileServer(assets)
+}
+
+/******** Mac Options ********/
+
+// ActivationPolicy is the activation policy for the application.
+type ActivationPolicy int
+
+const (
+ // ActivationPolicyRegular is used for applications that have a user interface,
+ 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
+)
+
+// MacOptions contains options for macOS applications.
+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
+}
+
+/****** Windows Options *******/
+
+// WindowsOptions contains options for Windows applications.
+type WindowsOptions struct {
+
+ // WndProcInterceptor is a function that will be called for every message sent in the application.
+ // Use this to hook into the main message loop. This is useful for handling custom window messages.
+ // If `shouldReturn` is `true` then `returnCode` will be returned by the main message loop.
+ // If `shouldReturn` is `false` then returnCode will be ignored and the message will be processed by the main message loop.
+ WndProcInterceptor func(hwnd uintptr, msg uint32, wParam, lParam uintptr) (returnCode uintptr, shouldReturn bool)
+
+ // DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
+ DisableQuitOnLastWindowClosed bool
+
+ // Path where the WebView2 stores the user data. If empty %APPDATA%\[BinaryName.exe] will be used.
+ // If the path is not valid, a messagebox will be displayed with the error and the app will exit with error code.
+ WebviewUserDataPath string
+
+ // Path to the directory with WebView2 executables. If empty WebView2 installed in the system will be used.
+ WebviewBrowserPath string
+}
+
+/********* Linux Options *********/
+
+// LinuxOptions contains options for Linux applications.
+type LinuxOptions struct {
+ // DisableQuitOnLastWindowClosed disables the auto quit of the application if the last window has been closed.
+ DisableQuitOnLastWindowClosed bool
+
+ // ProgramName is used to set the program's name for the window manager via GTK's g_set_prgname().
+ //This name should not be localized. [see the docs]
+ //
+ //When a .desktop file is created this value helps with window grouping and desktop icons when the .desktop file's Name
+ //property differs form the executable's filename.
+ //
+ //[see the docs]: https://docs.gtk.org/glib/func.set_prgname.html
+ ProgramName string
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Application dialogs
+
+Dangos Deialog Ynghylch#
+ShowAboutDialog()ShowAboutDialog() yn dangos blwch deialog "Ynghylch". Gall ddangos enw'r
+cymhwysiad, disgrifiad ac eicon.Gwybodaeth#
+InfoDialog()InfoDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog gyda
+InfoDialogType. Defnyddir y deialog hon fel arfer i ddangos negeseuon
+gwybodaeth i'r defnyddiwr.Cwestiwn#
+QuestionDialog()QuestionDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog
+gyda QuestionDialogType. Defnyddir y deialog hon yn aml i ofyn cwestiwn i'r
+defnyddiwr a disgwyl ymateb.Rhybudd#
+WarningDialog()WarningDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog
+gyda WarningDialogType. Fel y mae'r enw yn awgrymu, defnyddir y deialog hon yn
+bennaf i ddangos negeseuon rhybudd i'r defnyddiwr.Gwall#
+ErrorDialog()ErrorDialog() yn creu ac yn dychwelyd esiampl newydd o MessageDialog gyda
+ErrorDialogType. Cynlluniwyd y deialog hon i'w defnyddio pan fydd angen
+dangos neges gwall i'r defnyddiwr.Agor Ffeil#
+OpenFileDialog()OpenFileDialog() yn creu ac yn dychwelyd esiampl newydd o
+OpenFileDialogStruct. Mae'r deialog hon yn annog y defnyddiwr i ddewis un neu
+ragor o ffeiliau o'u system ffeiliau.Cadw Ffeil#
+SaveFileDialog()SaveFileDialog() yn creu ac yn dychwelyd esiampl newydd o
+SaveFileDialogStruct. Mae'r deialog hon yn annog y defnyddiwr i ddewis lleoliad
+yn eu system ffeiliau lle y dylid cadw ffeil.Agor Cyfeiriadur#
+OpenDirectoryDialog()OpenDirectoryDialog() yn creu ac yn dychwelyd esiampl newydd o
+MessageDialog gyda OpenDirectoryDialogType. Mae'r deialog hon yn galluogi'r
+defnyddiwr i ddewis cyfeiriadur o'u system ffeiliau.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Application events
+
+Ar#
+Ar(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()Ar() yn cofrestru gwrandäwr digwyddiad ar gyfer digwyddiadau cymhwysiad penodol. Bydd y swyddogaeth atebydd a ddarperir yn cael ei sbarduno pan fydd y digwyddiad cysylltiedig yn digwydd. Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r gwrandäwr.CofrestruArgraffwyr#
+CofrestruArgraffwyr(eventType digwyddiadau.DdigwyddiadweithgangeningApplicationEventType, atebydd func(digwyddiad *Digwyddiad)) func()CofrestruArgraffwyr() yn cofrestru atebydd i'w redeg fel crocen yn ystod digwyddiadau penodol. Caiff y crocenau hyn eu rhedeg cyn gwrandawyr sy'n gysylltiedig ag Ar(). Mae'r swyddogaeth yn dychwelyd swyddogaeth y gellir ei galw i dynnu'r bâs.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Application menu
+
+RegisterContextMenu#
+RegisterContextMenu(name string, menu *Menu)RegisterContextMenu() yn cofrestru dewislen cyd-destun gyda enw penodol. Gellir defnyddio'r dewislen hon yn ddiweddarach yn yr ap. // Creu dewislen newydd
+ ctxmenu := app.NewMenu()
+
+ // Cofrestru'r dewislen fel dewislen cyd-destun
+ app.RegisterContextMenu("MyContextMenu", ctxmenu)
+SetMenu#
+SetMenu(menu *Menu)SetMenu() yn gosod y ddewislen ar gyfer yr ap. Ar Mac, bydd hyn yn fod y ddewislen fyd-eang. Ar gyfer Windows a Linux, bydd hyn yn fod y ddewislen ddiofyn ar gyfer unrhyw ffenestr newydd a grëir.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Application screens
+
+GetPrimaryScreen#
+GetPrimaryScreen() (*Sgrin, error)GetPrimaryScreen() yn dychwelyd y sgrin brif y system.GetScreens#
+GetScreens() ([]*Sgrin, error)GetScreens() yn dychwelyd gwybodaeth am bob sgrin sydd wedi'i chysylltu â'r system.App strwythur a ddarparwyd. Cofiwch, ar gyfer mwy o swyddogaethau neu ystyriaethau manwl, cyfeiriwch at y cod Go gwirioneddol neu ddogfennaeth fewnol bellach.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Application window
+
+NewWebviewWindow#
+NewWebviewWindow() *WebviewWindowNewWebviewWindow() yn creu ffenestr Webview newydd gyda'r opsiynau rhagosodedig, ac yn ei dychwelyd.NewWebviewWindowWithOptions#
+NewWebviewWindowWithOptions(windowOptions WebviewWindowOptions) *WebviewWindowNewWebviewWindowWithOptions() yn creu ffenestr webview newydd gydag opsiynau custom. Caiff y ffenestr newydd ei ychwanegu at fap o ffenestri a reolir gan y cymhwysiad. // Creu ffenestr webview newydd gydag opsiynau custom
+ window := app.NewWebviewWindowWithOptions(WebviewWindowOptions{
+ Name: "Main",
+ Title: "Fy Ffenestr",
+ Width: 800,
+ Height: 600,
+ })
+OnWindowCreation#
+OnWindowCreation(callback func(window *WebviewWindow))OnWindowCreation() yn cofrestru ffwythiant alw-nôl i'w alw pan grëir ffenestr. // Cofrestru ffwythiant alw-nôl i'w alw pan grëir ffenestr
+ app.OnWindowCreation(func(window *WebviewWindow) {
+ // Gwneud rhywbeth
+ })
+GetWindowByName#
+GetWindowByName(name string) *WebviewWindowGetWindowByName() yn nôl ac yn dychwelyd ffenestr gyda enw penodol.CurrentWindow#
+CurrentWindow() *WebviewWindowCurrentWindow() yn nôl ac yn dychwelyd cyfeiriad at y ffenestr weithredol yn y cymhwysiad. Os nad oes ffenestr, mae'n dychwelyd nil.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Prif Swyddogaethau Trywydd#
+InvokeSync#
+InvokeSync(fn func())fn) yn ddilynebol. Mae'n defnyddio WaitGroup
+(wg) i sicrhau bod y prif drywydd yn aros i fn swyddogaeth orffen
+cyn iddo barhau. Os bydd panig yn digwydd o fewn fn, bydd yn cael ei drosglwyddo i'r
+swyddogaeth trin panig PanicHandler, a ddiffinnir yn opsiynau'r cymhwysiad.InvokeSyncWithResult#
+InvokeSyncWithResult[T any](fn func() T) (res T)InvokeSync(fn func()), fodd bynnag, mae'n rhoi
+canlyniad. Defnyddiwch hyn ar gyfer galw unrhyw swyddogaeth gyda un canlyniad yn unig.InvokeSyncWithError#
+InvokeSyncWithError(fn func() error) (err error)fn yn ddilynebol ac yn dychwelyd unrhyw wall a gynhyrchir gan fn.
+Sylwch y bydd y swyddogaeth hon yn adfer o banig os bydd un yn digwydd yn ystod
+gweithrediad fn.InvokeSyncWithResultAndError#
+InvokeSyncWithResultAndError[T any](fn func() (T, error)) (res T, err error)fn yn ddilynebol ac yn dychwelyd canlyniad o fath T a
+gwall.InvokeAsync#
+InvokeAsync(fn func())fn yn asyng. Mae'n rhedeg y swyddogaeth a roddir ar y
+prif drywydd. Os bydd panig yn digwydd o fewn fn, bydd yn cael ei drosglwyddo i'r
+swyddogaeth trin panig PanicHandler, a ddiffinnir yn opsiynau'r cymhwysiad.
+fn wedi gorffen. Mae'n
+hanfodol sicrhau nad yw fn yn rhwystro. Os bydd angen i chi redeg swyddogaeth sy'n
+rhwystro, defnyddiwch InvokeAsync yn lle.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dewislen#
+Dewislen math:Ychwanegu#
+Ychwanegu(label string) *EitemDewislenlabel o fath string fel mewnbwn ac yn ychwanegu
+EitemDewislen newydd gyda'r label a roddir at y ddewislen. Mae'n dychwelyd yr
+EitemDewislen a ychwanegwyd.YchwaneguSeparwr#
+YchwaneguSeparwr()EitemDewislen gwahanol newydd at y ddewislen.YchwaneguBlwch#
+YchwaneguBlwch(label string, galluogedig bool) *EitemDewislenlabel o fath string a galluogedig o fath bool
+fel mewnbwn ac yn ychwanegu EitemDewislen blwch ticio newydd gyda'r label a'r
+cyflwr galluogedig a roddir at y ddewislen. Mae'n dychwelyd yr EitemDewislen
+a ychwanegwyd.YchwaneguRadio#
+YchwaneguRadio(label string, galluogedig bool) *EitemDewislenlabel o fath string a galluogedig o fath bool
+fel mewnbwn ac yn ychwanegu EitemDewislen radio newydd gyda'r label a'r
+cyflwr galluogedig a roddir at y ddewislen. Mae'n dychwelyd yr EitemDewislen
+a ychwanegwyd.Diweddaru#
+Diweddaru()YchwaneguIsddewislen#
+YchwaneguIsddewislen(s string) *Dewislens o fath string fel mewnbwn ac yn ychwanegu
+EitemDewislen isddewislen newydd gyda'r label a roddir at y ddewislen. Mae'n
+dychwelyd yr isddewislen a ychwanegwyd.YchwaneguRôl#
+YchwaneguRôl(rôl Rôl) *Dewislenrôl o fath Rôl fel mewnbwn, yn ei ychwanegu at y
+ddewislen os nad yw'n nil ac yn dychwelyd y Dewislen.SetLabel#
+SetLabel(label string)label y Dewislen.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ardal Hysbysu#
+app.NewSystemTray():SystemTray math:SetLabel#
+SetLabel(label string)SetLabel yn gosod label yr ardal hysbysu.Label#
+Label() stringLabel yn adfer label yr ardal hysbysu.PositionWindow#
+PositionWindow(*WebviewWindow, offset int) errorPositionWindow yn galw'r dulliau AttachWindow a WindowOffset.SetIcon#
+SetIcon(icon []byte) *SystemTraySetIcon yn gosod eicon yr ardal hysbysu system.SetDarkModeIcon#
+SetDarkModeIcon(icon []byte) *SystemTraySetDarkModeIcon yn gosod eicon yr ardal hysbysu system pan mewn modd tywyll.SetMenu#
+SetMenu(menu *Menu) *SystemTraySetMenu yn gosod dewislen yr ardal hysbysu.Destroy#
+Destroy()Destroy yn dinistrio'r enghraifft ardal hysbysu.OnClick#
+OnClick(handler func()) *SystemTrayOnClick yn gosod y swyddogaeth i'w gweithredu pan fo'r eicon ardal hysbysu wedi'i glicio.OnRightClick#
+OnRightClick(handler func()) *SystemTrayOnRightClick yn gosod y swyddogaeth i'w gweithredu pan fo'r eicon ardal hysbysu wedi'i glicio â'r dde.OnDoubleClick#
+OnDoubleClick(handler func()) *SystemTrayOnDoubleClick yn gosod y swyddogaeth i'w gweithredu pan fo'r eicon ardal hysbysu wedi'i glicio ddwywaith.OnRightDoubleClick#
+OnRightDoubleClick(handler func()) *SystemTrayOnRightDoubleClick yn gosod y swyddogaeth i'w gweithredu pan fo'r eicon ardal hysbysu wedi'i glicio ddwywaith â'r dde.AttachWindow#
+AttachWindow(window *WebviewWindow) *SystemTrayAttachWindow yn atodi ffenestr i'r ardal hysbysu system. Bydd y ffenestr yn cael ei dangos pan fo'r eicon ardal hysbysu wedi'i glicio.WindowOffset#
+WindowOffset(offset int) *SystemTrayWindowOffset yn gosod y bwlch mewn picselau rhwng yr ardal hysbysu system a'r ffenestr.WindowDebounce#
+WindowDebounce(debounce time.Duration) *SystemTrayWindowDebounce yn gosod amser diddymu. Yng nghyd-destun Windows, defnyddir hyn i bennu faint o amser i aros cyn ymateb i ddigwyddiad clic llygoden i fyny ar yr eicon hysbysu.OpenMenu#
+OpenMenu()OpenMenu yn agor y ddewislen sy'n gysylltiedig â'r ardal hysbysu system.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Ffenestr#
+SetTitle#
+SetTitle(teitl string) *WebviewWindowEnw#
+Enw() stringSetSize#
+SetSize(lled, uchder int) *WebviewWindowSetAlwaysOnTop#
+SetAlwaysOnTop(b bool) *WebviewWindowDangos#
+Dangos() *WebviewWindowDangos yn cael ei ddefnyddio i wneud y ffenestr yn weladwy. Os
+nad yw'r ffenestr yn rhedeg, mae'n gwahodd y dull rhedeg i ddechrau'r ffenestr
+ac yna'n ei gwneud yn weladwy.Cuddio#
+Cuddio() *WebviewWindowCuddio yn cael ei ddefnyddio i guddio'r ffenestr. Mae'n gosod y
+statws cudd o'r ffenestr i wir ac yn lledu'r digwyddiad cuddio ffenestr.SetURL#
+SetURL(s string) *WebviewWindowSetURL yn cael ei ddefnyddio i osod URL y ffenestr i'r llinyn URL a ddarparwyd.SetZoom#
+SetZoom(mewnosod float64) *WebviewWindowSetZoom yn gosod lefel swm cynnwys y ffenestr i'r lefel mewnosod a ddarparwyd.GetZoom#
+GetZoom() float64GetZoom yn dychwelyd y lefel swm bresennol o gynnwys y ffenestr.GetScreen#
+GetScreen() (*Screen, error)GetScreen yn dychwelyd y sgrin lle mae'r ffenestr yn cael ei harddangos.SetFrameless#
+SetFrameless(frameless bool) *WebviewWindowRegisterContextMenu#
+RegisterContextMenu(enw string, dewislen *Dewislen)NativeWindowHandle#
+NativeWindowHandle() (uintptr, error)Ffocws#
+Ffocws()SetEnabled#
+SetEnabled(galluogwyd bool)SetAbsolutePosition#
+SetAbsolutePosition(x int, y int)
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Croniclau#
+
+
+[Heb ei ryddhau]#
+Ychwanegwyd#
+
+
+rhedeg:linux gan @marcus-crane yn #3146SetIcon gan @almas1992 yn PROnShutdown gan @almas1992 yn PRToggleMaximise yn y rhyngwyneb Window gan @fbbdev yn #3281Wedi Trwsio#
+
+
+go.mod i ddefnyddio llwybrau cymharol - Trwsio llwybrau Windows gyda gofodau gan @leaanthony.WebviewWindow.Restore gan @fbbdev yn #3279startURL yn gywir ar draws galwadau lluosog GetStartURL pan fo FRONTEND_DEVSERVER_URL yn bresennol. #3299Newidiwyd#
+Tynnwyd#
+Wedi Dibrisio#
+Diogelwch#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Newidiadau ar gyfer v3#
+Events#
+
+
+Application Events#
+ApplicationDidFinishLaunching on macOS.Window Events#
+WindowDidBecomeMain on macOS. Common events are also
+defined, so they work cross-platform, e.g. WindowClosing.Custom Events#
+WailsEvents. This is to differentiate
+them from the Event object that is used to communicate with the browser.
+WailsEvents are now objects that encapsulate all the details of an event. This
+includes the event name, the data, and the source of the event.Event callbacks and
+Emit function signature#On, Once & OnMultiple) have
+changed. In v2, the callback function received optional data. In v3, the
+callback function receives a WailsEvent object that contains all data related
+to the event.Emit function has changed. Instead of taking a name and
+optional data, it now takes a single WailsEvent object that it will emit.
+Off and OffAll#Off and OffAll calls would remove events in both JS and Go. Due to
+the multi-window nature of v3, this has been changed so that these methods only
+apply to the context they are called in. For example, if you call Off in a
+window, it will only remove events for that window. If you use Off in Go, it
+will only remove events for Go.Hooks#
+WindowClosing event and perform some cleanup before the window
+closes. Hooks can be registered at the application level or at the window level
+using RegisterHook. Application level are for application events. Window level
+hooks will only be called for the window they are registered with.Developer notes#
+Window#
+
+
+AbsolutePosition and ToggleDevTools.BackgroundColour#
+RGBA struct. In v3, this is an RGBA struct
+value.WindowIsTranslucent#
+BackgroundType flag that can be
+used to set the type of background the window should have. This flag can be set
+to any of the following values:
+
+BackgroundTypeSolid - The window will have a solid backgroundBackgroundTypeTransparent - The window will have a transparent backgroundBackgroundTypeTranslucent - The window will have a translucent backgroundBackgroundType is set to BackgroundTypeTranslucent, the
+type of translucency can be set using the BackdropType flag in the
+WindowsWindow options. This can be set to any of the following values:
+
+Auto - The window will use an effect determined by the systemNone - The window will have no backgroundMica - The window will use the Mica effectAcrylic - The window will use the acrylic effectTabbed - The window will use the tabbed effectSystray#
+
+
+Bindings#
+wails3 generate bindings command:// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Greet greets a person
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * GreetPerson greets a person
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+BindAliases option. This allows you to specify a map of alias IDs to
+method IDs. When the frontend calls a method using an ID, the method ID will be
+looked up in the alias map first for a match. If it does not find it, it assumes
+it's a standard method ID and tries to find the method in the usual way. app := application.New(application.Options{
+ Bind: []any{
+ &GreetService{},
+ },
+ BindAliases: map[uint32]uint32{
+ 1: 1411160069,
+ 2: 4021313248,
+ },
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+wails.Call(1, "world!").Insecure calls#
+wails.CallByName() method. This method takes the
+fully qualified name of the method to call and the arguments to pass to it.
+Example:```go
+wails.CallByName("main.GreetService.Greet", "world!")
+```
+Drag and Drop#
+EnableDragAndDrop window config option to true and the window will allow
+files to be dragged onto it. When this happens, the events.FilesDropped event
+will be emitted. The filenames can then be retrieved from the
+WindowEvent.Context() using the DroppedFiles() method. This returns a slice
+of strings containing the filenames.Context Menus#
+app.NewMenu(). To make the context menu available to a window, call
+window.RegisterContextMenu(name, menu). The name will be the id of the context
+menu and used by the frontend.data-contextmenu
+attribute to the element. The value of this attribute should be the name of a
+context menu previously registered with the window.app.RegisterContextMenu(name, menu). If a context menu cannot be found at the
+window level, the application context menus will be checked. A demo of this can
+be found in v3/examples/contextmenus.Dialogs#
+Windows#
+Ok and use OnClick() to set the
+callback method: dialog := app.QuestionDialog().
+ SetTitle("Update").
+ SetMessage("The cancel button is selected when pressing escape")
+ ok := dialog.AddButton("Ok")
+ ok.OnClick(func() {
+ // Do something
+ })
+ no := dialog.AddButton("Cancel")
+ dialog.SetDefaultButton(ok)
+ dialog.SetCancelButton(no)
+ dialog.Show()
+ClipBoard#
+Clipboard object
+that can be used to read and write to the clipboard. The Clipboard object is
+available in both Go and JS. SetText() to set the text and Text() to get the
+text.Wails Markup Language (WML)#
+
+data-wml-event#data-wml-confirm attribute to the element. The value of this attribute will be
+the message to display to the user.<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
+ Delete All Items
+</button>
+
+data-wml-window#wails.window method can be called by adding the data-wml-window
+attribute to an element. The value of the attribute should be the name of the
+method to call. The method name should be in the same case as the method.
+data-wml-trigger#click.Plugins#
+Creating a plugin#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() method returns the name of the plugin. This is used for logging
+purposes.Init(*application.App) error method is called when the plugin is loaded.
+The *application.App parameter is the application that the plugin is being
+loaded into. Any errors will prevent the application from starting.Shutdown() method is called when the application is shutting down.CallableByJS() method returns a list of exported functions that can be
+called from the frontend. These method names must exactly match the names of the
+methods exported by the plugin.InjectJS() method returns JavaScript that should be injected into all
+windows as they are created. This is useful for adding custom JavaScript
+functions that complement the plugin.Enums#
+
+
+float64? Can't we use int?
+
+int. Everything is a
+ number, which translates to float64 in Go. There are also restrictions
+ on casting types in Go's reflection package, which means using int doesn't
+ work.Logging#
+
+
+slog logger. This is
+ configured using the logger option in the application options. By default,
+ this uses the tint logger.log plugin which
+ utilises slog under the hood. This plugin provides a simple API for logging
+ to the console. It is available in both Go and JS.Misc#
+Windows Application Options#
+WndProcInterceptor#
+shouldReturn value should be set to true if the returnValue should be
+returned by the main wndProc method. If it is set to false, the return value
+will be ignored and the message will continue to be processed by the main
+wndProc method.Hide Window on Close + OnBeforeClose#
+HideWindowOnClose flag to hide the window when it closed.
+There was a logical overlap between this flag and the OnBeforeClose callback.
+In v3, the HideWindowOnClose flag has been removed and the OnBeforeClose
+callback has been renamed to ShouldClose. The ShouldClose callback is called
+when the user attempts to close a window. If the callback returns true, the
+window will close. If it returns false, the window will not close. This can be
+used to hide the window instead of closing it.Window Drag#
+--wails-drag attribute was used to indicate that an element could
+be used to drag the window. In v3, this has been replaced with
+--webkit-app-region to be more in line with the way other frameworks handle
+this. The --webkit-app-region attribute can be set to any of the following
+values:
+
+drag - The element can be used to drag the windowno-drag - The element cannot be used to drag the windowapp-region, however this is not supported
+by the getComputedStyle call on webkit on macOS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes bindings
+
+Rhwymedigaethau#
+wails3 generate bindings:// @ts-check
+// Mae'r ffeil hon wedi'i chynhyrchu'n awtomatig. PEIDIWCH Â'I GOLYGU
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Mae Greet yn cyfarch rhywun
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * Mae GreetPerson yn cyfarch rhywun
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+BindAliases. Mae hyn yn caniatáu ichi bennu map o IDs alias i
+IDs dull. Pan fydd y rhyngwyneb blaen yn galw dull gan ddefnyddio ID, bydd yr ID dull
+yn cael ei chwilio yn y map alias yn gyntaf am gywiro. Os nad yw'n ei ganfod,
+mae'n tybio mai ID dull safonol yw ac yn ceisio canfod y dull yn y ffordd arferol. app := application.New(application.Options{
+ Bind: []any{
+ &GreetService{},
+ },
+ BindAliases: map[uint32]uint32{
+ 1: 1411160069,
+ 2: 4021313248,
+ },
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+wails.Call(1, "byd!").Galwadau anniogel#
+wails.CallByName() anniogel. Mae'r dull hwn yn cymryd enw
+llawn cymhwysol y dull i'w alw a'r arguments i'w pasio iddo.
+Enghraifft:```go
+wails.CallByName("main.GreetService.Greet", "byd!")
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes clipboard
+
+ClipBoard#
+Clipboard y gellir ei ddefnyddio i ddarllen a chyflwyno i'r clipfwrdd. Mae'r gwrthrych Clipboard ar gael yn Go ac JS. SetText() i osod y testun a Text() i gael y testun.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes context menus
+
+Dewislenni Cyd-destun#
+app.NewMenu(). I wneud y ddewislen
+gyd-destun ar gael i ffenestr, galwch window.RegisterContextMenu(name, menu).
+Bydd y enw yn yr id o'r ddewislen gyd-destun ac a ddefnyddir gan y rhaglen
+wynebu.data-contextmenu at yr elfen. Dylai gwerth y priodoledd hwn fod yn enw o
+ddewislen gyd-destun a gofrestrwyd yn flaenorol gyda'r ffenestr.app.RegisterContextMenu(name, menu). Os na ellir dod o hyd i ddewislen
+gyd-destun ar lefel y ffenestr, bydd y dewislenni cyd-destun cymhwyso yn cael
+eu gwirio. Ceir demo o hyn yn v3/examples/contextmenus.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes dialogs
+
+Sgyrsiau#
+Ffenestri#
+Ok a defnyddio OnClick() i osod y
+dull galwad enw: dialog := app.QuestionDialog().
+ SetTitle("Diweddaru").
+ SetMessage("Mae'r botwm canslo yn cael ei ddewis pan fo'r bys dianc yn cael ei wasgu")
+ ok := dialog.AddButton("Ok")
+ ok.OnClick(func() {
+ // Gwneud rhywbeth
+ })
+ no := dialog.AddButton("Canslo")
+ dialog.SetDefaultButton(ok)
+ dialog.SetCancelButton(no)
+ dialog.Show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes dragndrop
+
+Llusgo a Gollwng#
+EnableDragAndDrop i true a bydd y ffenest yn
+caniatáu i ffeiliau gael eu llusgoi arni. Pan fydd hyn yn digwydd, bydd y
+digwyddiad events.FilesDropped yn cael ei yrru. Gellir yna nôl yr enwau
+ffeil o WindowEvent.Context() gan ddefnyddio'r dull DroppedFiles(). Mae
+hwn yn dychwelyd sleis o linynnau yn cynnwys yr enwau ffeil.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes enums
+
+Enawau#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ float64? Oni allwn ni ddefnyddio int?
+
+int. Mae popeth yn number, sy'n cyfieithu i float64 yn Go. Mae hefyd cyfyngiadau
+ ar daflu mathau yn pecyn adlewyrchu Go, sy'n golygu nad yw defnyddio int yn
+ gweithio.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes events
+
+Digwyddiadau#
+
+
+Digwyddiadau Cymhwysiad#
+ApplicationDidFinishLaunching ar macOS.Digwyddiadau Ffenestr#
+WindowDidBecomeMain ar macOS. Diffinnir digwyddiadau cyffredin hefyd, fel y maent yn gweithio ar draws platfformau, e.e. WindowClosing.Digwyddiadau Cyfaddas#
+WailsEvents. Mae hyn er mwyn eu gwahaniaethu o'r gwrthrych Event a ddefnyddir i gyfathrebu gyda'r porwr. Mae WailsEvents bellach yn wrthrychau sy'n erynu holl fanylion digwyddiad. Mae hyn yn cynnwys enw'r digwyddiad, y data, a ffynhonnell y digwyddiad.Galwadau digwyddiad a llofnod swyddogaeth
+Emit#On, Once & OnMultiple) wedi newid. Yn v2, naeth y swyddogaeth alwad dderbyn data dewisol. Yn v3, mae'r swyddogaeth alwad yn derbyn gwrthrych WailsEvent sy'n cynnwys yr holl ddata sy'n berthnasol i'r digwyddiad.Emit wedi newid. Yn lle cymryd enw a data dewisol, mae'n cymryd un gwrthrych WailsEvent y bydd yn ei allbynnu.
+Off a OffAll#Off a OffAll yn tynnu digwyddiadau i ffwrdd yn JS ac yn Go. Oherwydd natur aml-ffenestr v3, mae hyn wedi newid fel bod y dulliau hyn ond yn berthnasol i'r cyd-destun y'u galwyd. Er enghraifft, os ydych yn galw Off mewn ffenestr, dim ond digwyddiadau ar gyfer y ffenestr honno y bydd yn eu tynnu. Os ydych yn defnyddio Off yn Go, dim ond digwyddiadau ar gyfer Go y bydd yn eu tynnu.Bachau#
+WindowClosing a chyflawni rhywfaint o lanhau cyn i'r ffenestr gau. Gellir cofrestru bachau ar lefel y cymhwysiad neu ar lefel y ffenestr gan ddefnyddio RegisterHook. Bydd bachau lefel cymhwysiad ar gyfer digwyddiadau cymhwysiad. Bydd bachau lefel ffenestr ond yn cael eu galw ar gyfer y ffenestr y'u cofrestrir.Nodiadau datblygwr#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes logging
+
+Cofnodi#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ slog safonol Go. Caiff hwn ei ffurfweddu gan ddefnyddio'r opsiwn logger yn yr opsiynau cymhwysiad. Yn ddiofyn, mae hwn yn defnyddio'r cofnodwr tint.log newydd sy'n defnyddio slog o dan y rhyngwyneb. Mae'r ciplug hwn yn darparu API syml ar gyfer cofnodi i'r consol. Mae ar gael yn y naill iaith Go a JS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes misc
+
+Misc#
+Opsiynau Cymhwyso Windows#
+WndProcInterceptor#
+shouldReturn i true os dylai'r returnValue gael ei
+ddychwelyd gan y prif ddull wndProc. Os caiff ei osod i false, bydd y gwerth
+dychwelyd yn cael ei anwybyddu a bydd y neges yn parhau i gael ei phrosesu gan y prif
+ddull wndProc.Cuddio'r Ffenestr wrth Gau + OnBeforeClose#
+HideWindowOnClose i guddio'r ffenestr pan gaiff ei chau.
+Roedd gorgyffwrdd rhesymegol rhwng y fflag hon a'r galwad OnBeforeClose.
+Yn v3, mae'r fflag HideWindowOnClose wedi'i thynnu ac mae'r galwad OnBeforeClose
+wedi'i ailenwi i ShouldClose. Caiff y galwad ShouldClose ei galw pan fydd y
+defnyddiwr yn ceisio cau ffenestr. Os bydd y galwad yn dychwelyd true, caiff y
+ffenestr ei chau. Os yw'n dychwelyd false, ni chaiff y ffenestr ei chau. Gellir
+ei ddefnyddio i guddio'r ffenestr yn hytrach na'i chau.Llusgo Ffenestr#
+--wails-drag i nodi y gallai elfen gael ei
+defnyddio i lusgo'r ffenestr. Yn v3, mae hwn wedi'i ddisodli gan --webkit-app-region
+i fod yn fwy yn unol â'r ffordd y mae fframweithiau eraill yn ymdrin â hyn. Gellir
+gosod yr ymddangosiad --webkit-app-region i unrhyw un o'r gwerthoedd canlynol:
+
+drag - Gellir defnyddio'r elfen i lusgo'r ffenestrno-drag - Ni ellir defnyddio'r elfen i lusgo'r ffenestrapp-region, fodd bynnag, nid yw hwn yn cael ei
+gefnogi gan yr alwad getComputedStyle ar webkit ar macOS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes plugins
+
+Ategion#
+Creu ategyn#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() yn dychwelyd enw'r ategyn. Defnyddir hwn at ddibenion cofnodi.Init(*application.App) error yn cael ei alw pan gaiff yr ategyn ei lwytho.
+Mae'r paramedr *application.App yn gymhwysiad y caiff yr ategyn ei lwytho iddo. Bydd unrhyw
+wallau yn atal y cais rhag dechrau.Shutdown() yn cael ei alw pan fydd y cais yn cau.CallableByJS() yn dychwelyd rhestr o swyddogaethau alladwy y gellir eu galw o'r
+blaen-wyneb. Rhaid i enwau'r dulliau hyn gyfateb yn union i enwau'r dulliau a allodir
+gan yr ategyn.InjectJS() yn dychwelyd JavaScript y dylid ei fewnosod i bob ffenestr wrth iddynt
+gael eu creu. Mae hyn yn ddefnyddiol ar gyfer ychwanegu swyddogaethau JavaScript
+cyfatebol i'r ategyn.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes systray
+
+Syscynhwysydd#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes window
+
+Ffenestr#
+
+
+AbsolutePosition a ToggleDevTools.ColourCefndir#
+RGBA. Yn v3, mae hwn yn werthhRGBA` strwythur.FfenestrnynTranslucent#
+BackgroundType fflach y gellir ei defnyddio i osod y math o gefndir y dylai'r ffenestr ei chael. Gellir gosod y fflach hon i unrhyw un o'r gwerthoedd canlynol:
+
+BackgroundTypeSolid - Bydd gan y ffenestr gefndir soletBackgroundTypeTransparent - Bydd gan y ffenestr gefndir tryloywBackgroundTypeTranslucent - Bydd gan y ffenestr gefndir trawslucentBackgroundType wedi'i osod i BackgroundTypeTranslucent, gellir gosod y math o drawslucedd gan ddefnyddio'r fflach BackdropType yn opsiynau WindowsWindow. Gellir gosod hon i unrhyw un o'r gwerthoedd canlynol:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Auto - Bydd y ffenestr yn defnyddio effaith a benderfynir gan y systemNone - Ni fydd gan y ffenestr gefndirMica - Bydd y ffenestr yn defnyddio'r effaith MicaAcrylic - Bydd y ffenestr yn defnyddio'r effaith acryligTabbed - Bydd y ffenestr yn defnyddio'r effaith tabbed
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes wml
+
+Iaith Marcio Wails (WML)#
+
+data-wml-event#data-wml-confirm at yr elfen. Bydd gwerth y briodoledd
+hwn yn fesur i'w ddangos i'r defnyddiwr.<button data-wml-event="delete-all-items" data-wml-confirm="Ydych chi'n siŵr?">
+ Dileu Pob Eitem
+</button>
+
+data-wml-window#wails.window drwy ychwanegu'r briodoledd
+data-wml-window at elfen. Dylai gwerth y briodoledd fod yn enw'r
+dull i'w alw. Dylai enw'r dull fod yn yr un acen â'r dull.
+data-wml-trigger#click.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cyflwyniad#
+Cychwyn#
+
+
+v3-alpha.cd v3/cmd/wails3 && go installAdeiladu#
+go build safonol. Mae
+modd defnyddio go run hefyd.wails task --help.Cynllun prosiect#
+```
+v3
+├── cmd/wails3 // CLI
+├── examples // Enghreifftiau o apiau Wails
+├── internal // Pecynnau mewnol
+| ├── runtime // Y runtime JS Wails
+| └── templates // Y templed prosiect a gynhelir
+├── pkg
+| ├── application // Y llyfrgell Wails craidd
+| └── events // Diffiniadau digwyddiadau
+| └── mac // Cod penodol i macOS a ddefnyddir gan addasiadau
+| └── w32 // Cod penodol i Windows
+├── plugins // Addasiadau a gynhelir
+├── tasks // Tasgau cyffredinol
+└── Taskfile.yaml // Ffurfweddiad tasgau datblygu
+```
+Datblygu#
+Rhestr Tasgau Alpha#
+Ychwanegu swyddogaeth ffenestr#
+pkg/application/webview_window.go. Dylai hon weithredu'r holl
+swyddogaeth sydd ei hangen ar gyfer pob platfform. Dylid galw unrhyw god platfform
+penodol drwy fethôd webviewWindowImpl. Gweithredir y rhyngwyneb hwn gan bob un
+o'r platfformau targed i ddarparu'r swyddogaeth benodol i'r platfform. Mewn rhai
+achosion, efallai na fydd yn gwneud dim. Ar ôl ychwanegu'r dull rhyngwyneb,
+sicrhewch fod pob platfform yn ei weithredu. Mae'r dull SetMinSize yn enghraifft
+dda o hyn.
+
+webview_window_darwin.gowebview_window_windows.gowebview_window_linux.goinvokeSync wedi'u
+diffinio yn application.go.Diweddaru'r runtime#
+v3/internal/runtime. Pan diweddarir y runtime,
+rhaid cymryd y camau canlynol:Digwyddiadau#
+v3/pkg/events. Wrth ychwanegu digwyddiad newydd, rhaid
+cymryd y camau canlynol:
+
+events.txtwails3 task events:generatewindow_webview_darwin.go: // Translate ShouldClose to common WindowClosing event
+ w.parent.On(events.Mac.WindowShouldClose, func(_ *WindowEventContext) {
+ w.parent.emit(events.Common.WindowClosing)
+ })
+Addasiadau#
+Creu addasiad#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() yn dychwelyd enw'r addasiad. Defnyddir hwn at ddibenion
+cofnodi.Init(*application.App) error yn cael ei alw pan gaiff yr addasiad ei
+lwytho. Mae'r paramedr *application.App yn yr ap y caiff yr addasiad ei lwytho
+iddo. Bydd unrhyw wallau yn atal yr ap rhag cychwyn.Shutdown() pan gaiff yr ap ei ddidoli.CallableByJS() yn dychwelyd rhestr o swyddogaethau alladwy y gellir
+eu galw o'r blaen. Rhaid i enwau'r dulliau hyn gwatsh yn union ag enwau'r dulliau
+a alluogeir gan yr addasiad.InjectJS() yn dychwelyd JavaScript y dylid ei fewnosod i bob ffenestr
+wrth iddynt gael eu creu. Mae hyn yn ddefnyddiol ar gyfer ychwanegu swyddogaethau
+JavaScript cyfaddas i'r addasiad.v3/plugins. Edrychwch arnynt am
+ysbrydoliaeth.Tasgau#
+Taskfile.yaml. Y prif gyswllt â Task ddigwydd yn v3/internal/commands/task.go.Uwchraddio Taskfile#
+wails3 task -version a
+gwiriwch yn erbyn gwefan Task.v3/internal/commands/task.go.https://github.com/go-task/task a gwirio hanes y git i benderfynu beth sydd
+wedi newid a pham.Agor PR#
+mkdocs-website/docs.Tasgau Amrywiol#
+Uwchraddio Taskfile#
+Taskfile.yaml. Y prif gyswllt â Task ddigwydd yn v3/internal/commands/task.go.wails3 task -version a
+gwiriwch yn erbyn gwefan Task.v3/internal/commands/task.go.https://github.com/go-task/task a gwirio hanes y git i benderfynu beth sydd
+wedi newid a pham.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Statws#
+Mae'r rhestr hon yn gymysgedd o gymorth API cyhoeddus a mewnol.<br/>
+Nid yw'n gyflawn ac efallai nad yw'n gyfoes.
+Problemau Hysbys#
+
+
+Cymhwyster#
+
+
+
+
+
+
+
+Dull
+Windows
+Linux
+Mac
+Nodiadau
+
+
+run() gwall
+I
+I
+I
+
+
+
+destroy()
+
+ I
+I
+
+
+
+setApplicationMenu(menu *Menu)
+I
+I
+I
+
+
+
+name() llinell
+
+ I
+I
+
+
+
+getCurrentWindowID() uint
+I
+I
+I
+
+
+
+showAboutDialog(name llinell, description llinell, icon []byte)
+
+ I
+I
+
+
+
+setIcon(icon []byte)
+-
+I
+I
+
+
+
+on(id uint)
+
+
+ I
+
+
+
+dispatchOnMainThread(fn func())
+I
+I
+I
+
+
+
+cuddio()
+I
+I
+I
+
+
+
+dangos()
+I
+I
+I
+
+
+
+getPrimaryScreen() (*Screen, gwall)
+
+ I
+I
+
+
+
+
+getScreens() ([]*Screen, gwall)
+
+ I
+I
+
+ Ffenestr Gwe-weld#
+
+
+
+
+
+
+
+Dull
+Windows
+Linux
+Mac
+Nodiadau
+
+
+canolbwyntio()
+I
+I
+I
+
+
+
+cau()
+i
+I
+I
+
+
+
+destroy()
+
+ I
+I
+
+
+
+execJS(js llinell)
+i
+I
+I
+
+
+
+ffocws()
+I
+I
+
+
+
+
+forceReload()
+
+ I
+I
+
+
+
+fullscreen()
+I
+I
+I
+
+
+
+getScreen() (*Screen, gwall)
+i
+I
+I
+
+
+
+getZoom() float64
+
+ I
+I
+
+
+
+uchder() int
+I
+I
+I
+
+
+
+cuddio()
+I
+I
+I
+
+
+
+isFullscreen() bool
+I
+I
+I
+
+
+
+isMaximised() bool
+I
+I
+I
+
+
+
+isMinimised() bool
+I
+I
+I
+
+
+
+mwyhau()
+I
+I
+I
+
+
+
+lleihau()
+I
+I
+I
+
+
+
+nativeWindowHandle() (uintptr, gwall)
+I
+I
+I
+
+
+
+on(eventID uint)
+i
+
+ I
+
+
+
+openContextMenu(menu Menu, data ContextMenuData)
+i
+I
+I
+
+
+
+positionsberthol() (int, int)
+I
+I
+I
+
+
+
+ail-lwytho()
+i
+I
+I
+
+
+
+rhedeg()
+I
+I
+I
+
+
+
+setAlwaysOnTop(alwaysOnTop bool)
+I
+I
+I
+
+
+
+setBackgroundColour(color RGBA)
+I
+I
+I
+
+
+
+setEnabled(bool)
+
+ I
+I
+
+
+
+setFrameless(bool)
+
+ I
+I
+
+
+
+setFullscreenButtonEnabled(enabled bool)
+-
+I
+I
+Nid oes botwm sgrin lawn yn Windows
+
+
+setHTML(html llinell)
+I
+I
+I
+
+
+
+setMaxSize(width, uchder int)
+I
+I
+I
+
+
+
+setMinSize(width, uchder int)
+I
+I
+I
+
+
+
+setRelativePosition(x int, y int)
+I
+I
+I
+
+
+
+setResizable(resizable bool)
+I
+I
+I
+
+
+
+setSize(width, uchder int)
+I
+I
+I
+
+
+
+setTitle(title llinell)
+I
+I
+I
+
+
+
+setURL(url llinell)
+I
+I
+I
+
+
+
+setZoom(zoom float64)
+I
+I
+I
+
+
+
+dangos()
+I
+I
+I
+
+
+
+maint() (int, int)
+I
+I
+I
+
+
+
+toggleDevTools()
+I
+I
+I
+
+
+
+un-fullscreen()
+I
+I
+I
+
+
+
+un-mwyhau()
+I
+I
+I
+
+
+
+un-lleihau()
+I
+I
+I
+
+
+
+lled() int
+I
+I
+I
+
+
+
+chwyddo()
+
+ I
+I
+
+
+
+chwyddo()
+I
+I
+I
+
+
+
+chwyddo()
+I
+I
+I
+
+
+
+
+chwyddo()
+I
+I
+I
+
+ Amser Gweithredol#
+Cymhwyster#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+Gadael
+I
+I
+I
+
+
+
+Cuddio
+I
+I
+I
+
+
+
+
+Dangos
+I
+
+ I
+
+ Deialogau#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+Gwybodaeth
+I
+I
+I
+
+
+
+Rhybudd
+I
+I
+I
+
+
+
+Gwall
+I
+I
+I
+
+
+
+Cwestiwn
+I
+I
+I
+
+
+
+OpenFile
+I
+I
+I
+
+
+
+
+SaveFile
+I
+I
+I
+
+ Clipfwrdd#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+SetText
+I
+I
+I
+
+
+
+
+Text
+I
+I
+I
+
+ ContextMenu#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+OpenContextMenu
+I
+I
+I
+
+
+
+Ar Ddiofyn
+
+
+
+
+
+
+
+Rheoli drwy HTML
+I
+
+
+
+ contentEditable: true, <input> neu <textarea> tagiau neu â'r arddull --default-contextmenu: true osodwyd. Bydd arddull --default-contextmenu: show bob amser yn dangos y ddewislen cyd-destun Mae arddull --default-contextmenu: hide bob amser yn cuddio'r ddewislen cyd-destun--default-contextmenu: hide yn dangos y ddewislen cyd-destun oni bai ei fod yn cael ei osod yn benodol gyda --default-contextmenu: show.Sgriniau#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+GetAll
+I
+I
+I
+
+
+
+GetPrimary
+I
+I
+I
+
+
+
+
+GetCurrent
+I
+I
+I
+
+ System#
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+
+IsDarkMode
+
+
+ I
+
+ Ffenestr#
+
+
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+Canolbwyntio
+I
+I
+
+
+
+
+Ffocws
+I
+I
+
+
+
+
+FullScreen
+I
+I
+I
+
+
+
+GetZoom
+I
+I
+I
+Cael graddfa golwg gyfredol
+
+
+Uchder
+I
+I
+I
+
+
+
+Cuddio
+I
+I
+I
+
+
+
+Mwyhau
+I
+I
+I
+
+
+
+Lleihau
+I
+I
+I
+
+
+
+PositionsbertholRhyngwladol
+I
+I
+I
+
+
+
+Sgrin
+I
+I
+I
+Cael sgrin ar gyfer ffenestr
+
+
+SetAlwaysOnTop
+I
+I
+I
+
+
+
+SetBackgroundColour
+I
+I
+I
+https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621#issuecomment-938234294
+
+
+SetEnabled
+I
+U
+-
+Gosod y ffenestr i fod wedi'i galluogi/analluogi
+
+
+SetMaxSize
+I
+I
+I
+
+
+
+SetMinSize
+I
+I
+I
+
+
+
+SetRelativePosition
+I
+I
+I
+
+
+
+SetResizable
+I
+I
+I
+
+
+
+SetSize
+I
+I
+I
+
+
+
+SetTitle
+I
+I
+I
+
+
+
+SetZoom
+I
+I
+I
+Gosod graddfa golwg
+
+
+Dangos
+I
+I
+I
+
+
+
+Maint
+I
+I
+I
+
+
+
+UnFullscreen
+I
+I
+I
+
+
+
+UnMaximise
+I
+I
+I
+
+
+
+UnMinimise
+I
+I
+I
+
+
+
+Lled
+I
+I
+I
+
+
+
+ZoomIn
+I
+I
+I
+Cynyddu graddfa golwg
+
+
+ZoomOut
+I
+I
+I
+Gostwng graddfa golwg
+
+
+
+ZoomReset
+I
+I
+I
+Ailosod graddfa golwg
+Opsiynau Ffenestr#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+Nodwedd
+Windows
+Linux
+Mac
+Nodiadau
+
+
+AlwaysOnTop
+I
+I
+
+
+
+
+BackgroundColour
+I
+I
+
+
+
+
+BackgroundType
+
+
+
+ Mae'n ymddangos bod Acrylic yn gweithio ond nid y lleill
+
+
+CSS
+I
+I
+
+
+
+
+DevToolsEnabled
+I
+I
+I
+
+
+
+DisableResize
+I
+I
+
+
+
+
+EnableDragAndDrop
+
+ I
+
+
+
+
+EnableFraudulentWebsiteWarnings
+
+
+
+
+
+
+Ffocws
+I
+I
+
+
+
+
+Frameless
+I
+I
+
+
+
+
+FullscreenButtonEnabled
+I
+
+
+
+
+
+Uchder
+I
+I
+
+
+
+
+Hidden
+I
+I
+
+
+
+
+HTML
+I
+I
+
+
+
+
+JS
+I
+I
+
+
+
+
+Mac
+-
+-
+
+
+
+
+MaxHeight
+I
+I
+
+
+
+
+MaxWidth
+I
+I
+
+
+
+
+MinHeight
+I
+I
+
+
+
+
+MinWidth
+I
+I
+
+
+
+
+Enw
+I
+I
+
+
+
+
+OpenInspectorOnStartup
+
+
+
+
+
+
+StartState
+I
+
+
+
+
+
+Teitl
+I
+I
+
+
+
+
+URL
+I
+I
+
+
+
+
+Lled
+I
+I
+
+
+
+
+Windows
+I
+-
+-
+
+
+
+
+X
+I
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Adborth#
+
+
+Bug i'r post.wails doctor yn eich post.v3/example cyfeiriadur neu greu enghraifft newydd yn y v3/examples ffolder sy'n dangos y broblem yn glir.[v3 alpha test] <disgrifiad o'r nam>.
+
+[v3 alpha].PR i'r post.
+
+Awgrym i'r post.
+
+. Arhoswch ar gyfer unrhyw bostiau sy'n flaenoriaeth i chi.
Beth rydym yn chwilio am adborth arno#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Gosod#
+git clone https://github.com/wailsapp/wails.git
+cd wails
+git checkout v3-alpha
+cd v3/cmd/wails3
+go install
+Platfformau a Gefnogir#
+
+
+Dibyniaeth#
+PATH yn cynnwys llwybr eich cyfeiriadur ~/go/bin. Ailgychwynnwch eich terfynell a gwiriwch y canlynol:
+
+go version~/go/bin yn eich PATH: echo $PATH | grep go/binnpm --version i wirio.wails3 task yn lle task.
+Bydd gosod Task yn rhoi'r hyblygrwydd mwyaf i chi.Dibyniaeth Penodol i'r Platfform#
+wails doctor.gcc safonol a libgtk3 a libwebkit ar Linux. Yn hytrach nag rhestru llawer o orchmynion ar gyfer gwahanol ddosbarthiadau, gall Wails geisio penderfynu beth yw'r gorchmynion gosod ar gyfer eich dosbarthiad penodol. Rhedwch wails doctor ar ôl gosod i weld y cyfarwyddiadau ar sut i osod y dibyniaeth. Os na chefnogir eich dosbarthiad/rheolwr pecyn, rhowch wybod i ni ar discord.Gwirio'r System#
+wails3 doctor yn gwirio a oes gennych y dibyniaeth cywir
+wedi'i gosod. Os nad oes, bydd yn rhoi cyngor ar yr hyn sydd ar goll a sut i
+unioni
+unrhyw broblemau.Mae'r gorchymyn
+wails3 yn ymddangos fel ei fod ar goll?#wails3 ar goll, gwiriwch y
+canlynol:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ go/bin yn y newidyn amgylchedd PATH.PATH newydd.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Camau Nesaf#
+Enghreifftiau#
+examples yn y storfa Wails.
+Mae hyn yn cynnwys nifer o enghreifftiau y gallwch eu rhedeg a chwarae â nhw.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Dy Cymhwysiad Cyntaf#
+Gofynion Rhewydd#
+
+
+Cam 1: Creu Prosiect Newydd#
+wails3 init -n myfirstappmyfirstapp gyda'r holl ffeiliau angenrheidiol.Cam 2: Archwilio Strwythur y Prosiect#
+myfirstapp. Byddwch yn canfod nifer o ffeiliau a ffolderi:
+
+build: Yn cynnwys ffeiliau a ddefnyddir gan y broses adeiladu.frontend: Yn cynnwys cod rhagflaen eich rhyngrwyd.go.mod a go.sum: Ffeiliau modiwl Go.main.go: Pwynt mynediad eich cymhwysiad Wails.Taskfile.yml: Yn diffinio'r holl dasgau a ddefnyddir gan y system adeiladu. Dysgu rhagor ar wefan Task.make neu unrhyw system adeiladu amgen. Cam 3: Adeiladu Eich Cymhwysiad#
+wails3 buildbin newydd.
+Gallwch ei redeg fel unrhyw gymhwysiad arferol:./bin/myfirstappbin\myfirstapp.exe./bin/myfirstappCam 4: Modd Datblygu#
+
+
+wails3 dev.frontend/main.js.<h1>Hello Wails!</h1> i <h1>Helo Byd!</h1>.Cam 5: Ailadeiladu'r Cymhwysiad#
+wails3 buildbuild.Casgliad#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cartref#
+Cyflwyniad#
+Beth sydd Newydd#
+
+
+Cychwyn#
+
+
+Hysbysiad Fersiwn Alpha#
+Adborth a Chyfraniadau#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wails v3 Plugin Guide#
+Plugin Structure#
+
+
+plugin.go: This is the main Go file where the plugin's functionality is implemented.plugin.yaml: This is the plugin's metadata file. It contains information about the plugin such as its name, author, version, and more.assets/: This directory contains any static assets that the plugin might need.README.md: This file provides documentation for the plugin.Plugin Implementation#
+plugin.go, a plugin is defined as a struct that implements the application.Plugin interface. This interface requires the following methods:
+
+Init(): This method is called when the plugin is initialized.Shutdown(): This method is called when the application is shutting down.Name(): This method returns the name of the plugin.CallableByJS(): This method returns a list of method names that can be called from the frontend.wails.Plugin() function.Plugin Metadata#
+plugin.yaml file contains metadata about the plugin. This includes the plugin's name, description, author, version, website, repository, and license.Plugin Assets#
+assets/ directory.
+These assets can be accessed by the frontend by requesting them at the plugin base path.
+This path is /wails/plugins/<plugin-name>/.Example#
+logopack has an asset named logo.png, the frontend can access it at /wails/plugins/logopack/logo.png.Plugin Documentation#
+README.md file provides documentation for the plugin. This should include instructions on how to install and use the plugin, as well as any other information that users of the plugin might find useful.Example#
+package log
+
+import (
+ "embed"
+ _ "embed"
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "io/fs"
+ "log/slog"
+)
+
+//go:embed assets/*
+var assets embed.FS
+
+// ---------------- Plugin Setup ----------------
+// This is the main plugin struct. It can be named anything you like.
+// It must implement the application.Plugin interface.
+// Both the Init() and Shutdown() methods are called synchronously when the app starts and stops.
+
+type Config struct {
+ // Logger is the logger to use. If not set, a default logger will be used.
+ Logger *slog.Logger
+
+ // LogLevel defines the log level of the logger.
+ LogLevel slog.Level
+
+ // Handles errors that occur when writing to the log
+ ErrorHandler func(err error)
+}
+
+type Plugin struct {
+ config *Config
+ app *application.App
+ level slog.LevelVar
+}
+
+func NewPluginWithConfig(config *Config) *Plugin {
+ if config.Logger == nil {
+ config.Logger = application.DefaultLogger(config.LogLevel)
+ }
+
+ result := &Plugin{
+ config: config,
+ }
+ result.level.Set(config.LogLevel)
+ return result
+}
+
+func NewPlugin() *Plugin {
+ return NewPluginWithConfig(&Config{})
+}
+
+// Shutdown is called when the app is shutting down
+// You can use this to clean up any resources you have allocated
+func (p *Plugin) Shutdown() error { return nil }
+
+// Name returns the name of the plugin.
+// You should use the go module format e.g. github.com/myuser/myplugin
+func (p *Plugin) Name() string {
+ return "github.com/wailsapp/wails/v3/plugins/log"
+}
+
+func (p *Plugin) Init(api application.PluginAPI) error {
+ return nil
+}
+
+// CallableByJS returns a list of methods that can be called from the frontend
+func (p *Plugin) CallableByJS() []string {
+ return []string{
+ "Debug",
+ "Info",
+ "Warning",
+ "Error",
+ "SetLogLevel",
+ }
+}
+
+func (p *Plugin) Assets() fs.FS {
+ return assets
+}
+
+// ---------------- Plugin Methods ----------------
+// Plugin methods are just normal Go methods. You can add as many as you like.
+// The only requirement is that they are exported (start with a capital letter).
+// You can also return any type that is JSON serializable.
+// See https://golang.org/pkg/encoding/json/#Marshal for more information.
+
+func (p *Plugin) Debug(message string, args ...any) {
+ p.config.Logger.Debug(message, args...)
+}
+
+func (p *Plugin) Info(message string, args ...any) {
+ p.config.Logger.Info(message, args...)
+}
+
+func (p *Plugin) Warning(message string, args ...any) {
+ p.config.Logger.Warn(message, args...)
+}
+
+func (p *Plugin) Error(message string, args ...any) {
+ p.config.Logger.Error(message, args...)
+}
+
+func (p *Plugin) SetLogLevel(level slog.Level) {
+ p.level.Set(level)
+}
+Support#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Amser Rhedeg#
+
+
+
+
+@wailsio/runtimeDefnyddio'r pecyn
+@wailsio/runtime#@wailsio/runtime yn becyn JavaScript sy'n darparu mynediad at amser rhedeg Wails. Fe'i defnyddir gan yr holl dempled safonol ac mae'n y ffordd a argymhellir i integreiddio'r amser rhedeg i'ch cais. Drwy ddefnyddio'r pecyn, dim ond y rhannau o'r amser rhedeg yr ydych yn eu defnyddio a gaiff eu cynnwys.Defnyddio fersiwn wedi'i chyn-adeiladu o'r amser rhedeg#
+v3/examples. Gellir cynhyrchu'r fersiwn wedi'i chyn-adeiladu o'r amser rhedeg gan ddefnyddio'r gorchymyn canlynol:runtime.js (a runtime.debug.js) yn y cyfeiriadur presennol.
+Gellir defnyddio'r ffeil hon gan eich cais drwy ei hychwanegu at eich cyfeiriadur asedau (fel arfer frontend/dist) ac yna ei chynnwys yn eich HTML:
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Cynllun Gweithredu#
+Materion Hysbys#
+
+
+Camau Milltir Alpha#
+Presennol: Alpha 5#
+Nodau#
+Sut Gallaf Helpu?#
+
+
+Statws#
+
+
+
+
+
+
+
+
+
+Example
+Linux
+
+
+binding
+
+
+
+build
+
+
+
+clipboard
+
+
+
+context menus
+
+
+
+dialogs
+
+
+
+drag-n-drop
+
+
+
+events
+
+
+
+frameless
+
+
+
+keybindings
+
+
+
+plain
+
+
+
+screen
+
+
+
+systray
+
+
+
+video
+
+
+
+window
+
+
+
+
+wml
+
+ Camau Milltir Nesaf#
+Alpha 6#
+Camau Milltir Blaenorol#
+Alpha 4 - Wedi'i Chwblhau 2024-02-01#
+Nodau#
+dev a package.
+Dylai'r gorchymyn wails dev wneud y canlynol:
+- Adeiladu'r cais
+- Cychwyn y cais
+- Cychwyn y gweinydd datblygu blaen
+- Gwylio am newidiadau i'r cod cais ac ail-adeiladu/ailgychwyn yn ôl yr angenwails package wneud y canlynol:
+- Adeiladu'r cais
+- Pecynnu'r cais mewn fformat penodol i'r platfform
+ - Windows: Rhaglen weithredol safonol, Gosodwr NSIS
+ - Linux: AppImage
+ - MacOS: Rhaglen weithredol safonol, Pecyn App
+- Cefnogi gwrthodiad y cod cais
+
+Sut Gallaf Helpu?#
+
+
+wails3 doctor a sicrhau bod yr holl ddibyniaeth wedi'u gosod. wails3 init.wails3 dev:
+
+wails3 dev yn y cyfeiriadur project. Dylai redeg y cais mewn modd datblygu.wails3 dev -help i weld yr opsiynau.wails3 package:
+
+wails3 package yn y cyfeiriadur project.wails3 package -help i weld yr opsiynau.Statws#
+wails3 dev:
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+
+
+
+
+wails3 dev
+
+
+
+
+wails3 package:
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+
+
+Standard Executable
+
+
+
+
+
+macOS Application Bundle
+
+
+
+
+
+
+NSIS
+
+
+
+ Alpha 3 - Wedi'i Chwblhau 2024-01-14#
+Nodau#
+Sut Gallaf Helpu?#
+wails3 generate bindings. Bydd hyn yn cynhyrchu rhwymau ar gyfer holl fethodoedd strwythur a ranbir gyda'ch project.
+Rhedeg wails3 generate bindings -help i weld yr opsiynau sy'n llywodraethu sut caiff rhwymau eu cynhyrchu.testdata. v3/internal/parser. Gellir rhedeg yr holl brofion gan ddefnyddio go test ./... o'r cyfeiriadur v3.
+Yn y bôn, ceisiwch ei dorri a rhowch wybod i ni os ydych yn dod o hyd i unrhyw faterion! Statws#
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Same package
+
+
+
+
+
+Different package
+
+
+
+
+
+Different package with same name
+on hold
+on hold
+on hold
+
+
+Containing another struct from same package
+
+
+
+
+
+Containing another struct from different package
+
+
+
+
+
+
+Containing an anonymous struct
+
+
+
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Same package
+:material-check-bold
+
+
+
+
+Different package
+
+
+
+
+
+Different package with same name
+on hold
+on hold
+on hold
+
+
+Containing another struct from same package
+
+
+
+
+
+Containing another struct from different package
+
+
+
+
+
+
+Containing an anonymous struct
+
+
+
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Class model for struct in same package
+
+
+
+
+
+Class model for struct in different package
+
+
+
+
+
+Interface model for struct in same package
+
+
+
+
+
+Interface model for struct in different package
+
+
+
+
+
+Enum in same package
+
+
+
+
+
+Enum in different package
+
+
+
+
+
+Interface using enum in same package
+
+
+
+
+
+
+Interface using enum in different package
+
+
+
+
+
+Alpha 2#
+Nodau#
+Statws#
+
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+WSL
+
+
+
+wails init
+
+
+
+
+
+
+
+wails build
+
+
+
+ Alpha 1#
+Nodau#
+Statws#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Linux
+Notes
+
+
+binding
+
+
+
+
+build
+
+
+
+
+clipboard
+
+
+
+
+context menus
+
+
+
+
+dialogs
+
+
+
+
+drag-n-drop
+
+
+
+
+events
+
+
+
+
+frameless
+
+
+
+
+keybindings
+
+
+
+
+plain
+
+
+
+
+screen
+
+
+
+
+systray
+
+
+
+
+video
+
+
+
+
+window
+
+
+
+
+
+wml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Beth sydd newydd yn Wails v3 Alpha#
+Amlder Ffenestri#
+package main
+
+import (
+ _ "embed"
+ "log"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+)
+
+//go:embed assets/*
+var assets embed.FS
+
+func main() {
+
+ app := application.New(application.Options{
+ Name: "Multi Window Demo",
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ })
+
+ window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Ffenest 1",
+ })
+
+ window2 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Ffenest 2",
+ })
+
+ // llwytho'r html wedi'i ymgorffori o'r embed.FS
+ window1.SetURL("/")
+ window1.Center()
+
+ // Llwytho URL allanol
+ window2.SetURL("https://wails.app")
+
+ err := app.Run()
+
+ if err != nil {
+ log.Fatal(err.Error())
+ }
+}
+Systriedi#
+
+
+package main
+
+import (
+ _ "embed"
+ "log"
+ "runtime"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "github.com/wailsapp/wails/v3/pkg/icons"
+)
+
+func main() {
+ app := application.New(application.Options{
+ Name: "Systray Demo",
+ Mac: application.MacOptions{
+ ActivationPolicy: application.ActivationPolicyAccessory,
+ },
+ })
+
+ window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Width: 500,
+ Height: 800,
+ Frameless: true,
+ AlwaysOnTop: true,
+ Hidden: true,
+ Windows: application.WindowsWindow{
+ HiddenOnTaskbar: true,
+ },
+ })
+
+ systemTray := app.NewSystemTray()
+
+ // Cefnogaeth ar gyfer eicon thema ar macOS
+ if runtime.GOOS == "darwin" {
+ systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
+ } else {
+ // Cefnogaeth ar gyfer eicon modd golau/tywyll
+ systemTray.SetDarkModeIcon(icons.SystrayDark)
+ systemTray.SetIcon(icons.SystrayLight)
+ }
+
+ // Cefnogaeth ar gyfer dewislen
+ myMenu := app.NewMenu()
+ myMenu.Add("Hello World!").OnClick(func(_ *application.Context) {
+ println("Hello World!")
+ })
+ systemTray.SetMenu(myMenu)
+
+ // Bydd hyn yn canoli'r ffenestr i'r eicon systrai gyda 5px o leoliad
+ // Bydd yn cael ei ddangos yn awtomatig pan fo'r eicon systrai wedi'i glicio
+ // a'i guddio pan fo'r ffenestr yn colli ffocws
+ systemTray.AttachWindow(window).WindowOffset(5)
+
+ err := app.Run()
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+Atchwanegion#
+
+
+Genedigaeth cysylltiadau gwelledig#
+wails3 generate bindings yn unig yn ystod cyfeiriadur y prosiect.// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Greet greets a person
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * GreetPerson greets a person
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+System adeiladu gwelledig#
+build:darwin:
+ summary: Builds the application
+ platforms:
+ - darwin
+ cmds:
+ - task: pre-build
+ - task: build-frontend
+ - go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
+ - task: post-build
+ env:
+ CGO_CFLAGS: "-mmacosx-version-min=10.13"
+ CGO_LDFLAGS: "-mmacosx-version-min=10.13"
+ MACOSX_DEPLOYMENT_TARGET: "10.13"
+Digwyddiadau gwelledig#
+On ond yn synchronaidd ac yn caniatáu i chi ddiddymu'r digwyddiad. Enghraifft o hyn fyddai dangos cadarnhad cyn cau ffenestr.package main
+
+import (
+ _ "embed"
+ "log"
+ "time"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "github.com/wailsapp/wails/v3/pkg/events"
+)
+
+//go:embed assets
+var assets embed.FS
+
+func main() {
+
+ app := application.New(application.Options{
+ Name: "Events Demo",
+ Description: "A demo of the Events API",
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+
+ // Trin digwyddiadau cwstom
+ app.Events.On("myevent", func(e *application.WailsEvent) {
+ log.Printf("[Go] WailsEvent received: %+v\n", e)
+ })
+
+ // Digwyddiadau cymhwysiad penodol i'r system weithredu
+ app.On(events.Mac.ApplicationDidFinishLaunching, func(event *application.Event) {
+ println("events.Mac.ApplicationDidFinishLaunching fired!")
+ })
+
+ // Digwyddiadau agnostig i'r platfform
+ app.On(events.Common.ApplicationStarted, func(event *application.Event) {
+ println("events.Common.ApplicationStarted fired!")
+ })
+
+ win1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Takes 3 attempts to close me!",
+ })
+
+ var countdown = 3
+
+ // Cofrestru bachyn i ddiddymu'r ffenestr yn cau
+ win1.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
+ countdown--
+ if countdown == 0 {
+ println("Closing!")
+ return
+ }
+ println("Nope! Not closing!")
+ e.Cancel()
+ })
+
+ win1.On(events.Common.WindowFocus, func(e *application.WindowEvent) {
+ println("[Event] Window focus!")
+ })
+
+ err := app.Run()
+
+ if err != nil {
+ log.Fatal(err.Error())
+ }
+}
+Iaith Marcio Wails (wml)#
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Wails ML Demo</title>
+ </head>
+ <body style="margin-top:50px; color: white; background-color: #191919">
+ <h2>Wails ML Demo</h2>
+ <p>Mae'r cymhwysiad hwn yn cynnwys dim JavaScript!</p>
+ <button wml-event="button-pressed">Pwyswch fi!</button>
+ <button wml-event="delete-things" wml-confirm="Ydych chi'n siŵr?">
+ Dileu'r holl bethau!
+ </button>
+ <button wml-window="Close" wml-confirm="Ydych chi'n siŵr?">
+ Cau'r Ffenestr?
+ </button>
+ <button wml-window="Center">Canoli</button>
+ <button wml-window="Minimise">Lleihauo</button>
+ <button wml-window="Maximise">Mwyhau</button>
+ <button wml-window="UnMaximise">Dad-fwyhauo</button>
+ <button wml-window="Fullscreen">Sgrin lawn</button>
+ <button wml-window="UnFullscreen">Dad-sgrin lawn</button>
+ <button wml-window="Restore">Adfer</button>
+ <div
+ style="width: 200px; height: 200px; border: 2px solid white;"
+ wml-event="hover"
+ wml-trigger="mouseover"
+ >
+ Fy/Goresgyn fi
+ </div>
+ </body>
+</html>
+Enghreifftiau#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes for v3#
+Events#
+
+
+Application Events#
+ApplicationDidFinishLaunching on macOS.Window Events#
+WindowDidBecomeMain on macOS. Common events are also
+defined, so they work cross-platform, e.g. WindowClosing.Custom Events#
+WailsEvents. This is to differentiate
+them from the Event object that is used to communicate with the browser.
+WailsEvents are now objects that encapsulate all the details of an event. This
+includes the event name, the data, and the source of the event.Event callbacks and
+Emit function signature#On, Once & OnMultiple) have
+changed. In v2, the callback function received optional data. In v3, the
+callback function receives a WailsEvent object that contains all data related
+to the event.Emit function has changed. Instead of taking a name and
+optional data, it now takes a single WailsEvent object that it will emit.
+Off and OffAll#Off and OffAll calls would remove events in both JS and Go. Due to
+the multi-window nature of v3, this has been changed so that these methods only
+apply to the context they are called in. For example, if you call Off in a
+window, it will only remove events for that window. If you use Off in Go, it
+will only remove events for Go.Hooks#
+WindowClosing event and perform some cleanup before the window
+closes. Hooks can be registered at the application level or at the window level
+using RegisterHook. Application level are for application events. Window level
+hooks will only be called for the window they are registered with.Developer notes#
+Window#
+
+
+AbsolutePosition and ToggleDevTools.BackgroundColour#
+RGBA struct. In v3, this is an RGBA struct
+value.WindowIsTranslucent#
+BackgroundType flag that can be
+used to set the type of background the window should have. This flag can be set
+to any of the following values:
+
+BackgroundTypeSolid - The window will have a solid backgroundBackgroundTypeTransparent - The window will have a transparent backgroundBackgroundTypeTranslucent - The window will have a translucent backgroundBackgroundType is set to BackgroundTypeTranslucent, the
+type of translucency can be set using the BackdropType flag in the
+WindowsWindow options. This can be set to any of the following values:
+
+Auto - The window will use an effect determined by the systemNone - The window will have no backgroundMica - The window will use the Mica effectAcrylic - The window will use the acrylic effectTabbed - The window will use the tabbed effectSystray#
+
+
+Bindings#
+wails3 generate bindings command:// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Greet greets a person
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * GreetPerson greets a person
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+BindAliases option. This allows you to specify a map of alias IDs to
+method IDs. When the frontend calls a method using an ID, the method ID will be
+looked up in the alias map first for a match. If it does not find it, it assumes
+it's a standard method ID and tries to find the method in the usual way. app := application.New(application.Options{
+ Bind: []any{
+ &GreetService{},
+ },
+ BindAliases: map[uint32]uint32{
+ 1: 1411160069,
+ 2: 4021313248,
+ },
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+wails.Call(1, "world!").Insecure calls#
+wails.CallByName() method. This method takes the
+fully qualified name of the method to call and the arguments to pass to it.
+Example:```go
+wails.CallByName("main.GreetService.Greet", "world!")
+```
+Drag and Drop#
+EnableDragAndDrop window config option to true and the window will allow
+files to be dragged onto it. When this happens, the events.FilesDropped event
+will be emitted. The filenames can then be retrieved from the
+WindowEvent.Context() using the DroppedFiles() method. This returns a slice
+of strings containing the filenames.Context Menus#
+app.NewMenu(). To make the context menu available to a window, call
+window.RegisterContextMenu(name, menu). The name will be the id of the context
+menu and used by the frontend.data-contextmenu
+attribute to the element. The value of this attribute should be the name of a
+context menu previously registered with the window.app.RegisterContextMenu(name, menu). If a context menu cannot be found at the
+window level, the application context menus will be checked. A demo of this can
+be found in v3/examples/contextmenus.Dialogs#
+Windows#
+Ok and use OnClick() to set the
+callback method: dialog := app.QuestionDialog().
+ SetTitle("Update").
+ SetMessage("The cancel button is selected when pressing escape")
+ ok := dialog.AddButton("Ok")
+ ok.OnClick(func() {
+ // Do something
+ })
+ no := dialog.AddButton("Cancel")
+ dialog.SetDefaultButton(ok)
+ dialog.SetCancelButton(no)
+ dialog.Show()
+ClipBoard#
+Clipboard object
+that can be used to read and write to the clipboard. The Clipboard object is
+available in both Go and JS. SetText() to set the text and Text() to get the
+text.Wails Markup Language (WML)#
+
+data-wml-event#data-wml-confirm attribute to the element. The value of this attribute will be
+the message to display to the user.<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
+ Delete All Items
+</button>
+
+data-wml-window#wails.window method can be called by adding the data-wml-window
+attribute to an element. The value of the attribute should be the name of the
+method to call. The method name should be in the same case as the method.
+data-wml-trigger#click.Plugins#
+Creating a plugin#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() method returns the name of the plugin. This is used for logging
+purposes.Init(*application.App) error method is called when the plugin is loaded.
+The *application.App parameter is the application that the plugin is being
+loaded into. Any errors will prevent the application from starting.Shutdown() method is called when the application is shutting down.CallableByJS() method returns a list of exported functions that can be
+called from the frontend. These method names must exactly match the names of the
+methods exported by the plugin.InjectJS() method returns JavaScript that should be injected into all
+windows as they are created. This is useful for adding custom JavaScript
+functions that complement the plugin.Enums#
+
+
+float64? Can't we use int?
+
+int. Everything is a
+ number, which translates to float64 in Go. There are also restrictions
+ on casting types in Go's reflection package, which means using int doesn't
+ work.Logging#
+
+
+slog logger. This is
+ configured using the logger option in the application options. By default,
+ this uses the tint logger.log plugin which
+ utilises slog under the hood. This plugin provides a simple API for logging
+ to the console. It is available in both Go and JS.Misc#
+Windows Application Options#
+WndProcInterceptor#
+shouldReturn value should be set to true if the returnValue should be
+returned by the main wndProc method. If it is set to false, the return value
+will be ignored and the message will continue to be processed by the main
+wndProc method.Hide Window on Close + OnBeforeClose#
+HideWindowOnClose flag to hide the window when it closed.
+There was a logical overlap between this flag and the OnBeforeClose callback.
+In v3, the HideWindowOnClose flag has been removed and the OnBeforeClose
+callback has been renamed to ShouldClose. The ShouldClose callback is called
+when the user attempts to close a window. If the callback returns true, the
+window will close. If it returns false, the window will not close. This can be
+used to hide the window instead of closing it.Window Drag#
+--wails-drag attribute was used to indicate that an element could
+be used to drag the window. In v3, this has been replaced with
+--webkit-app-region to be more in line with the way other frameworks handle
+this. The --webkit-app-region attribute can be set to any of the following
+values:
+
+drag - The element can be used to drag the windowno-drag - The element cannot be used to drag the windowapp-region, however this is not supported
+by the getComputedStyle call on webkit on macOS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes bindings
+
+Bindings#
+wails3 generate bindings command:// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Greet greets a person
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * GreetPerson greets a person
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+BindAliases option. This allows you to specify a map of alias IDs to
+method IDs. When the frontend calls a method using an ID, the method ID will be
+looked up in the alias map first for a match. If it does not find it, it assumes
+it's a standard method ID and tries to find the method in the usual way. app := application.New(application.Options{
+ Bind: []any{
+ &GreetService{},
+ },
+ BindAliases: map[uint32]uint32{
+ 1: 1411160069,
+ 2: 4021313248,
+ },
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+wails.Call(1, "world!").Insecure calls#
+wails.CallByName() method. This method takes the
+fully qualified name of the method to call and the arguments to pass to it.
+Example:```go
+wails.CallByName("main.GreetService.Greet", "world!")
+```
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes clipboard
+
+ClipBoard#
+Clipboard object
+that can be used to read and write to the clipboard. The Clipboard object is
+available in both Go and JS. SetText() to set the text and Text() to get the
+text.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes context menus
+
+Context Menus#
+app.NewMenu(). To make the context menu available to a window, call
+window.RegisterContextMenu(name, menu). The name will be the id of the context
+menu and used by the frontend.data-contextmenu
+attribute to the element. The value of this attribute should be the name of a
+context menu previously registered with the window.app.RegisterContextMenu(name, menu). If a context menu cannot be found at the
+window level, the application context menus will be checked. A demo of this can
+be found in v3/examples/contextmenus.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes dialogs
+
+Dialogs#
+Windows#
+Ok and use OnClick() to set the
+callback method: dialog := app.QuestionDialog().
+ SetTitle("Update").
+ SetMessage("The cancel button is selected when pressing escape")
+ ok := dialog.AddButton("Ok")
+ ok.OnClick(func() {
+ // Do something
+ })
+ no := dialog.AddButton("Cancel")
+ dialog.SetDefaultButton(ok)
+ dialog.SetCancelButton(no)
+ dialog.Show()
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes dragndrop
+
+Drag and Drop#
+EnableDragAndDrop window config option to true and the window will allow
+files to be dragged onto it. When this happens, the events.FilesDropped event
+will be emitted. The filenames can then be retrieved from the
+WindowEvent.Context() using the DroppedFiles() method. This returns a slice
+of strings containing the filenames.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes enums
+
+Enums#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ float64? Can't we use int?
+
+int. Everything is a
+ number, which translates to float64 in Go. There are also restrictions
+ on casting types in Go's reflection package, which means using int doesn't
+ work.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes events
+
+Events#
+
+
+Application Events#
+ApplicationDidFinishLaunching on macOS.Window Events#
+WindowDidBecomeMain on macOS. Common events are also
+defined, so they work cross-platform, e.g. WindowClosing.Custom Events#
+WailsEvents. This is to differentiate
+them from the Event object that is used to communicate with the browser.
+WailsEvents are now objects that encapsulate all the details of an event. This
+includes the event name, the data, and the source of the event.Event callbacks and
+Emit function signature#On, Once & OnMultiple) have
+changed. In v2, the callback function received optional data. In v3, the
+callback function receives a WailsEvent object that contains all data related
+to the event.Emit function has changed. Instead of taking a name and
+optional data, it now takes a single WailsEvent object that it will emit.
+Off and OffAll#Off and OffAll calls would remove events in both JS and Go. Due to
+the multi-window nature of v3, this has been changed so that these methods only
+apply to the context they are called in. For example, if you call Off in a
+window, it will only remove events for that window. If you use Off in Go, it
+will only remove events for Go.Hooks#
+WindowClosing event and perform some cleanup before the window
+closes. Hooks can be registered at the application level or at the window level
+using RegisterHook. Application level are for application events. Window level
+hooks will only be called for the window they are registered with.Developer notes#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes logging
+
+Logging#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ slog logger. This is
+ configured using the logger option in the application options. By default,
+ this uses the tint logger.log plugin which
+ utilises slog under the hood. This plugin provides a simple API for logging
+ to the console. It is available in both Go and JS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes misc
+
+Misc#
+Windows Application Options#
+WndProcInterceptor#
+shouldReturn value should be set to true if the returnValue should be
+returned by the main wndProc method. If it is set to false, the return value
+will be ignored and the message will continue to be processed by the main
+wndProc method.Hide Window on Close + OnBeforeClose#
+HideWindowOnClose flag to hide the window when it closed.
+There was a logical overlap between this flag and the OnBeforeClose callback.
+In v3, the HideWindowOnClose flag has been removed and the OnBeforeClose
+callback has been renamed to ShouldClose. The ShouldClose callback is called
+when the user attempts to close a window. If the callback returns true, the
+window will close. If it returns false, the window will not close. This can be
+used to hide the window instead of closing it.Window Drag#
+--wails-drag attribute was used to indicate that an element could
+be used to drag the window. In v3, this has been replaced with
+--webkit-app-region to be more in line with the way other frameworks handle
+this. The --webkit-app-region attribute can be set to any of the following
+values:
+
+drag - The element can be used to drag the windowno-drag - The element cannot be used to drag the windowapp-region, however this is not supported
+by the getComputedStyle call on webkit on macOS.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes plugins
+
+Plugins#
+Creating a plugin#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() method returns the name of the plugin. This is used for logging
+purposes.Init(*application.App) error method is called when the plugin is loaded.
+The *application.App parameter is the application that the plugin is being
+loaded into. Any errors will prevent the application from starting.Shutdown() method is called when the application is shutting down.CallableByJS() method returns a list of exported functions that can be
+called from the frontend. These method names must exactly match the names of the
+methods exported by the plugin.InjectJS() method returns JavaScript that should be injected into all
+windows as they are created. This is useful for adding custom JavaScript
+functions that complement the plugin.
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes systray
+
+Systray#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes window
+
+Window#
+
+
+AbsolutePosition and ToggleDevTools.BackgroundColour#
+RGBA struct. In v3, this is an RGBA struct
+value.WindowIsTranslucent#
+BackgroundType flag that can be
+used to set the type of background the window should have. This flag can be set
+to any of the following values:
+
+BackgroundTypeSolid - The window will have a solid backgroundBackgroundTypeTransparent - The window will have a transparent backgroundBackgroundTypeTranslucent - The window will have a translucent backgroundBackgroundType is set to BackgroundTypeTranslucent, the
+type of translucency can be set using the BackdropType flag in the
+WindowsWindow options. This can be set to any of the following values:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Auto - The window will use an effect determined by the systemNone - The window will have no backgroundMica - The window will use the Mica effectAcrylic - The window will use the acrylic effectTabbed - The window will use the tabbed effect
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Changes wml
+
+Wails Markup Language (WML)#
+
+data-wml-event#data-wml-confirm attribute to the element. The value of this attribute will be
+the message to display to the user.<button data-wml-event="delete-all-items" data-wml-confirm="Are you sure?">
+ Delete All Items
+</button>
+
+data-wml-window#wails.window method can be called by adding the data-wml-window
+attribute to an element. The value of the attribute should be the name of the
+method to call. The method name should be in the same case as the method.
+data-wml-trigger#click.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Introduction#
+Getting Started#
+
+
+v3-alpha branch.cd v3/cmd/wails3 && go installBuilding#
+go build command. It's also
+possible to use go run.wails task --help.Project layout#
+```
+v3
+├── cmd/wails3 // CLI
+├── examples // Examples of Wails apps
+├── internal // Internal packages
+| ├── runtime // The Wails JS runtime
+| └── templates // The supported project templates
+├── pkg
+| ├── application // The core Wails library
+| └── events // The event definitions
+| └── mac // macOS specific code used by plugins
+| └── w32 // Windows specific code
+├── plugins // Supported plugins
+├── tasks // General tasks
+└── Taskfile.yaml // Development tasks configuration
+```
+Development#
+Alpha Todo List#
+Adding window functionality#
+pkg/application/webview_window.go file. This should implement all the
+functionality required for all platforms. Any platform specific code should be
+called via a webviewWindowImpl interface method. This interface is implemented
+by each of the target platforms to provide the platform specific functionality.
+In some cases, this may do nothing. Once you've added the interface method,
+ensure each platform implements it. A good example of this is the SetMinSize
+method.
+
+webview_window_darwin.gowebview_window_windows.gowebview_window_linux.goinvokeSync methods defined in
+application.go.Updating the runtime#
+v3/internal/runtime. When the runtime is updated,
+the following steps need to be taken:Events#
+v3/pkg/events. When adding a new event, the following
+steps need to be taken:
+
+events.txt filewails3 task events:generatewindow_webview_darwin.go: // Translate ShouldClose to common WindowClosing event
+ w.parent.On(events.Mac.WindowShouldClose, func(_ *WindowEventContext) {
+ w.parent.emit(events.Common.WindowClosing)
+ })
+Plugins#
+Creating a plugin#
+type Plugin interface {
+ Name() string
+ Init(*application.App) error
+ Shutdown()
+ CallableByJS() []string
+ InjectJS() string
+}
+Name() method returns the name of the plugin. This is used for logging
+purposes.Init(*application.App) error method is called when the plugin is loaded.
+The *application.App parameter is the application that the plugin is being
+loaded into. Any errors will prevent the application from starting.Shutdown() method is called when the application is shutting down.CallableByJS() method returns a list of exported functions that can be
+called from the frontend. These method names must exactly match the names of the
+methods exported by the plugin.InjectJS() method returns JavaScript that should be injected into all
+windows as they are created. This is useful for adding custom JavaScript
+functions that complement the plugin.v3/plugins directory. Check them out
+for inspiration.Tasks#
+Taskfile.yaml. The main
+interfacing with Task happens in v3/internal/commands/task.go.Upgrading Taskfile#
+wails3 task -version and
+check against the Task website.v3/internal/commands/task.go file.https://github.com/go-task/task and look at the git history to determine what
+has changed and why.Opening a PR#
+mkdocs-website/docs directory.Misc Tasks#
+Upgrading Taskfile#
+Taskfile.yaml. The main
+interfacing with Task happens in v3/internal/commands/task.go.wails3 task -version and
+check against the Task website.v3/internal/commands/task.go file.https://github.com/go-task/task and look at the git history to determine what
+has changed and why.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Status#
+This list is a mixture of public and internal API support.<br/>
+It is not complete and probably not up to date.
+Known Issues#
+
+
+Application#
+
+
+
+
+
+
+
+Method
+Windows
+Linux
+Mac
+Notes
+
+
+run() error
+Y
+Y
+Y
+
+
+
+destroy()
+
+ Y
+Y
+
+
+
+setApplicationMenu(menu *Menu)
+Y
+Y
+Y
+
+
+
+name() string
+
+ Y
+Y
+
+
+
+getCurrentWindowID() uint
+Y
+Y
+Y
+
+
+
+showAboutDialog(name string, description string, icon []byte)
+
+ Y
+Y
+
+
+
+setIcon(icon []byte)
+-
+Y
+Y
+
+
+
+on(id uint)
+
+
+ Y
+
+
+
+dispatchOnMainThread(fn func())
+Y
+Y
+Y
+
+
+
+hide()
+Y
+Y
+Y
+
+
+
+show()
+Y
+Y
+Y
+
+
+
+getPrimaryScreen() (*Screen, error)
+
+ Y
+Y
+
+
+
+
+getScreens() ([]*Screen, error)
+
+ Y
+Y
+
+ Webview Window#
+
+
+
+
+
+
+
+Method
+Windows
+Linux
+Mac
+Notes
+
+
+center()
+Y
+Y
+Y
+
+
+
+close()
+y
+Y
+Y
+
+
+
+destroy()
+
+ Y
+Y
+
+
+
+execJS(js string)
+y
+Y
+Y
+
+
+
+focus()
+Y
+Y
+
+
+
+
+forceReload()
+
+ Y
+Y
+
+
+
+fullscreen()
+Y
+Y
+Y
+
+
+
+getScreen() (*Screen, error)
+y
+Y
+Y
+
+
+
+getZoom() float64
+
+ Y
+Y
+
+
+
+height() int
+Y
+Y
+Y
+
+
+
+hide()
+Y
+Y
+Y
+
+
+
+isFullscreen() bool
+Y
+Y
+Y
+
+
+
+isMaximised() bool
+Y
+Y
+Y
+
+
+
+isMinimised() bool
+Y
+Y
+Y
+
+
+
+maximise()
+Y
+Y
+Y
+
+
+
+minimise()
+Y
+Y
+Y
+
+
+
+nativeWindowHandle() (uintptr, error)
+Y
+Y
+Y
+
+
+
+on(eventID uint)
+y
+
+ Y
+
+
+
+openContextMenu(menu Menu, data ContextMenuData)
+y
+Y
+Y
+
+
+
+relativePosition() (int, int)
+Y
+Y
+Y
+
+
+
+reload()
+y
+Y
+Y
+
+
+
+run()
+Y
+Y
+Y
+
+
+
+setAlwaysOnTop(alwaysOnTop bool)
+Y
+Y
+Y
+
+
+
+setBackgroundColour(color RGBA)
+Y
+Y
+Y
+
+
+
+setEnabled(bool)
+
+ Y
+Y
+
+
+
+setFrameless(bool)
+
+ Y
+Y
+
+
+
+setFullscreenButtonEnabled(enabled bool)
+-
+Y
+Y
+There is no fullscreen button in Windows
+
+
+setHTML(html string)
+Y
+Y
+Y
+
+
+
+setMaxSize(width, height int)
+Y
+Y
+Y
+
+
+
+setMinSize(width, height int)
+Y
+Y
+Y
+
+
+
+setRelativePosition(x int, y int)
+Y
+Y
+Y
+
+
+
+setResizable(resizable bool)
+Y
+Y
+Y
+
+
+
+setSize(width, height int)
+Y
+Y
+Y
+
+
+
+setTitle(title string)
+Y
+Y
+Y
+
+
+
+setURL(url string)
+Y
+Y
+Y
+
+
+
+setZoom(zoom float64)
+Y
+Y
+Y
+
+
+
+show()
+Y
+Y
+Y
+
+
+
+size() (int, int)
+Y
+Y
+Y
+
+
+
+toggleDevTools()
+Y
+Y
+Y
+
+
+
+unfullscreen()
+Y
+Y
+Y
+
+
+
+unmaximise()
+Y
+Y
+Y
+
+
+
+unminimise()
+Y
+Y
+Y
+
+
+
+width() int
+Y
+Y
+Y
+
+
+
+zoom()
+
+ Y
+Y
+
+
+
+zoomIn()
+Y
+Y
+Y
+
+
+
+zoomOut()
+Y
+Y
+Y
+
+
+
+
+zoomReset()
+Y
+Y
+Y
+
+ Runtime#
+Application#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+Quit
+Y
+Y
+Y
+
+
+
+Hide
+Y
+Y
+Y
+
+
+
+
+Show
+Y
+
+ Y
+
+ Dialogs#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+Info
+Y
+Y
+Y
+
+
+
+Warning
+Y
+Y
+Y
+
+
+
+Error
+Y
+Y
+Y
+
+
+
+Question
+Y
+Y
+Y
+
+
+
+OpenFile
+Y
+Y
+Y
+
+
+
+
+SaveFile
+Y
+Y
+Y
+
+ Clipboard#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+SetText
+Y
+Y
+Y
+
+
+
+
+Text
+Y
+Y
+Y
+
+ ContextMenu#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+OpenContextMenu
+Y
+Y
+Y
+
+
+
+On By Default
+
+
+
+
+
+
+
+Control via HTML
+Y
+
+
+
+ contentEditable: true, <input> or <textarea> tags or have the
+--default-contextmenu: true style set. The --default-contextmenu: show style
+will always show the context menu The --default-contextmenu: hide style will
+always hide the context menu--default-contextmenu: hide style will not
+show the context menu unless it is explicitly set with
+--default-contextmenu: show.Screens#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+GetAll
+Y
+Y
+Y
+
+
+
+GetPrimary
+Y
+Y
+Y
+
+
+
+
+GetCurrent
+Y
+Y
+Y
+
+ System#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+
+IsDarkMode
+
+
+ Y
+
+ Window#
+
+
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+Center
+Y
+Y
+Y
+
+
+
+Focus
+Y
+Y
+
+
+
+
+FullScreen
+Y
+Y
+Y
+
+
+
+GetZoom
+Y
+Y
+Y
+Get current view scale
+
+
+Height
+Y
+Y
+Y
+
+
+
+Hide
+Y
+Y
+Y
+
+
+
+Maximise
+Y
+Y
+Y
+
+
+
+Minimise
+Y
+Y
+Y
+
+
+
+RelativePosition
+Y
+Y
+Y
+
+
+
+Screen
+Y
+Y
+Y
+Get screen for window
+
+
+SetAlwaysOnTop
+Y
+Y
+Y
+
+
+
+SetBackgroundColour
+Y
+Y
+Y
+https://github.com/MicrosoftEdge/WebView2Feedback/issues/1621#issuecomment-938234294
+
+
+SetEnabled
+Y
+U
+-
+Set the window to be enabled/disabled
+
+
+SetMaxSize
+Y
+Y
+Y
+
+
+
+SetMinSize
+Y
+Y
+Y
+
+
+
+SetRelativePosition
+Y
+Y
+Y
+
+
+
+SetResizable
+Y
+Y
+Y
+
+
+
+SetSize
+Y
+Y
+Y
+
+
+
+SetTitle
+Y
+Y
+Y
+
+
+
+SetZoom
+Y
+Y
+Y
+Set view scale
+
+
+Show
+Y
+Y
+Y
+
+
+
+Size
+Y
+Y
+Y
+
+
+
+UnFullscreen
+Y
+Y
+Y
+
+
+
+UnMaximise
+Y
+Y
+Y
+
+
+
+UnMinimise
+Y
+Y
+Y
+
+
+
+Width
+Y
+Y
+Y
+
+
+
+ZoomIn
+Y
+Y
+Y
+Increase view scale
+
+
+ZoomOut
+Y
+Y
+Y
+Decrease view scale
+
+
+
+ZoomReset
+Y
+Y
+Y
+Reset view scale
+Window Options#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+AlwaysOnTop
+Y
+Y
+
+
+
+
+BackgroundColour
+Y
+Y
+
+
+
+
+BackgroundType
+
+
+
+ Acrylic seems to work but the others don't
+
+
+CSS
+Y
+Y
+
+
+
+
+DevToolsEnabled
+Y
+Y
+Y
+
+
+
+DisableResize
+Y
+Y
+
+
+
+
+EnableDragAndDrop
+
+ Y
+
+
+
+
+EnableFraudulentWebsiteWarnings
+
+
+
+
+
+
+Focused
+Y
+Y
+
+
+
+
+Frameless
+Y
+Y
+
+
+
+
+FullscreenButtonEnabled
+Y
+
+
+
+
+
+Height
+Y
+Y
+
+
+
+
+Hidden
+Y
+Y
+
+
+
+
+HTML
+Y
+Y
+
+
+
+
+JS
+Y
+Y
+
+
+
+
+Mac
+-
+-
+
+
+
+
+MaxHeight
+Y
+Y
+
+
+
+
+MaxWidth
+Y
+Y
+
+
+
+
+MinHeight
+Y
+Y
+
+
+
+
+MinWidth
+Y
+Y
+
+
+
+
+Name
+Y
+Y
+
+
+
+
+OpenInspectorOnStartup
+
+
+
+
+
+
+StartState
+Y
+
+
+
+
+
+Title
+Y
+Y
+
+
+
+
+URL
+Y
+Y
+
+
+
+
+Width
+Y
+Y
+
+
+
+
+Windows
+Y
+-
+-
+
+
+
+X
+Y
+Y
+
+
+
+
+Y
+Y
+Y
+
+
+
+
+Zoom
+
+
+
+
+
+
+
+ZoomControlEnabled
+
+
+
+
+ Log#
+Menu#
+
+
+
+
+
+
+
+Event
+Windows
+Linux
+Mac
+Notes
+
+
+
+Default Application Menu
+Y
+Y
+Y
+
+ Tray Menus#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+Icon
+Y
+Y
+Y
+Windows has default icons for light/dark mode & supports PNG or ICO.
+
+
+Label
+-
+Y
+Y
+
+
+
+Label (ANSI Codes)
+-
+
+
+
+
+
+
+Menu
+Y
+Y
+Y
+
+ Methods#
+
+
+
+
+
+
+
+Method
+Windows
+Linux
+Mac
+Notes
+
+
+setLabel(label string)
+-
+Y
+Y
+
+
+
+run()
+Y
+Y
+Y
+
+
+
+setIcon(icon []byte)
+Y
+Y
+Y
+
+
+
+setMenu(menu *Menu)
+Y
+Y
+Y
+
+
+
+setIconPosition(position int)
+-
+Y
+Y
+
+
+
+setTemplateIcon(icon []byte)
+-
+Y
+Y
+
+
+
+destroy()
+Y
+Y
+Y
+
+
+
+
+setDarkModeIcon(icon []byte)
+Y
+Y
+Y
+Darkmode isn't handled yet (linux)
+Cross Platform Events#
+
+
+
+
+
+
+
+Event
+Windows
+Linux
+Mac
+Notes
+
+
+WindowWillClose
+
+
+ WindowWillClose
+
+
+
+WindowDidClose
+
+
+
+
+
+
+WindowDidResize
+
+
+
+
+
+
+WindowDidHide
+
+
+
+
+
+
+
+ApplicationWillTerminate
+
+
+
+
+ Bindings Generation#
+Models Generation#
+Task file#
+Theme#
+
+
+
+
+
+
+
+Mode
+Windows
+Linux
+Mac
+Notes
+
+
+Dark
+Y
+
+
+
+
+
+Light
+Y
+
+
+
+
+
+
+System
+Y
+
+
+
+ NSIS Installer#
+Templates#
+Plugins#
+
+
+
+
+
+
+
+Plugin
+Windows
+Linux
+Mac
+Notes
+
+
+Browser
+Y
+
+ Y
+
+
+
+KV Store
+Y
+Y
+Y
+
+
+
+Log
+Y
+Y
+Y
+
+
+
+Single Instance
+Y
+
+ Y
+
+
+
+SQLite
+Y
+Y
+Y
+
+
+
+Start at login
+Y
+
+ Y
+
+
+
+
+Server
+
+
+
+
+
+
+Packaging#
+
+
+
+
+
+
+
+
+ Windows
+Linux
+Mac
+Notes
+
+
+Icon Generation
+Y
+
+ Y
+
+
+
+Icon Embedding
+Y
+
+ Y
+
+
+
+Info.plist
+-
+
+ Y
+
+
+
+NSIS Installer
+
+
+ -
+
+
+
+Mac bundle
+-
+
+ Y
+
+
+
+
+Windows exe
+Y
+
+ -
+
+ Frameless Windows#
+
+
+
+
+
+
+
+Feature
+Windows
+Linux
+Mac
+Notes
+
+
+Resize
+Y
+
+ Y
+
+
+
+
+Drag
+Y
+Y
+Y
+Linux - can always drag with
+Meta+left mouseMac Specific#
+
+
+Mac Options#
+
+
+
+
+
+
+
+Feature
+Default
+Notes
+
+
+Backdrop
+MacBackdropNormal
+Standard solid window
+
+
+DisableShadow
+false
+
+
+
+TitleBar
+
+ Standard window decorations by default
+
+
+Appearance
+DefaultAppearance
+
+
+
+InvisibleTitleBarHeight
+0
+Creates an invisible title bar for frameless windows
+
+
+
+DisableShadow
+false
+Disables the window drop shadow
+Windows Specific#
+
+
+Windows Options#
+
+
+
+
+
+
+
+Feature
+Default
+Notes
+
+
+BackdropType
+Solid
+
+
+
+DisableIcon
+false
+
+
+
+Theme
+SystemDefault
+
+
+
+CustomTheme
+nil
+
+
+
+DisableFramelessWindowDecorations
+false
+
+
+
+
+WindowMask
+nil
+Makes the window the contents of the bitmap
+Linux Specific#
+*_linux.go files are
+located in the following files:
+
+CGO#
+Purego#
+CGO_ENABLED=0 go build -tags purego
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Feedback#
+
+
+Bug tag.wails doctor in your post.v3/example directory or create a new example in the v3/examples folder that clearly shows the issue.[v3 alpha test] <description of bug>.
+
+[v3 alpha].PR tag.
+
+Suggestion tag.
+
+ emoji. Please apply to any posts that are a priority for you.
Things we are looking for feedback on#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Installation#
+git clone https://github.com/wailsapp/wails.git
+cd wails
+git checkout v3-alpha
+cd v3/cmd/wails3
+go install
+Supported Platforms#
+
+
+Dependencies#
+PATH environment variable also includes the path to your ~/go/bin directory. Restart your terminal and do the following checks:
+
+go version~/go/bin is in your PATH variable: echo $PATH | grep go/binnpm --version to verify.wails3 task command instead of task.
+Installing Task will give you the greatest flexibility.Platform Specific Dependencies#
+wails doctor command.gcc build tools plus libgtk3 and libwebkit. Rather than list a ton of commands for different distros, Wails can try to determine what the installation commands are for your specific distribution. Run wails doctor after installation to be shown how to install the dependencies. If your distro/package manager is not supported, please let us know on discord.System Check#
+wails3 doctor will check if you have the correct dependencies
+installed. If not, it will advise on what is missing and help on how to rectify
+any problems.The
+wails3 command appears to be missing?#wails3 command is missing, check the
+following:
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ go/bin directory is in the PATH environment variable.PATH variable.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Next Steps#
+Examples#
+examples directory in the Wails repository.
+This contains a number of examples that you can run and play with.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Your First Application#
+Prerequisites#
+
+
+Step 1: Creating a New Project#
+wails3 init -n myfirstappmyfirstapp with all the necessary files.Step 2: Exploring the Project Structure#
+myfirstapp directory. You'll find several files and folders:
+
+build: Contains files used by the build process.frontend: Contains your web frontend code.go.mod & go.sum: Go module files.main.go: The entry point for your Wails application.Taskfile.yml: Defines all the tasks used by the build system. Learn more at the Task website.make or any other alternative build system. Step 3: Building Your Application#
+wails3 buildbin directory.
+You can run this like you would any normal application:./bin/myfirstappbin\myfirstapp.exe./bin/myfirstappStep 4: Dev Mode#
+
+
+wails3 dev.frontend/main.js.<h1>Hello Wails!</h1> to <h1>Hello World!</h1>.Step 5: Building the Application Again#
+wails3 buildbuild directory.Conclusion#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Home#
+Introduction#
+What's New#
+
+
+Getting Started#
+
+
+Alpha Version Notice#
+Feedback and Contributions#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Wails v3 Plugin Guide#
+Plugin Structure#
+
+
+plugin.go: This is the main Go file where the plugin's functionality is implemented.plugin.yaml: This is the plugin's metadata file. It contains information about the plugin such as its name, author, version, and more.assets/: This directory contains any static assets that the plugin might need.README.md: This file provides documentation for the plugin.Plugin Implementation#
+plugin.go, a plugin is defined as a struct that implements the application.Plugin interface. This interface requires the following methods:
+
+Init(): This method is called when the plugin is initialized.Shutdown(): This method is called when the application is shutting down.Name(): This method returns the name of the plugin.CallableByJS(): This method returns a list of method names that can be called from the frontend.wails.Plugin() function.Plugin Metadata#
+plugin.yaml file contains metadata about the plugin. This includes the plugin's name, description, author, version, website, repository, and license.Plugin Assets#
+assets/ directory.
+These assets can be accessed by the frontend by requesting them at the plugin base path.
+This path is /wails/plugins/<plugin-name>/.Example#
+logopack has an asset named logo.png, the frontend can access it at /wails/plugins/logopack/logo.png.Plugin Documentation#
+README.md file provides documentation for the plugin. This should include instructions on how to install and use the plugin, as well as any other information that users of the plugin might find useful.Example#
+package log
+
+import (
+ "embed"
+ _ "embed"
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "io/fs"
+ "log/slog"
+)
+
+//go:embed assets/*
+var assets embed.FS
+
+// ---------------- Plugin Setup ----------------
+// This is the main plugin struct. It can be named anything you like.
+// It must implement the application.Plugin interface.
+// Both the Init() and Shutdown() methods are called synchronously when the app starts and stops.
+
+type Config struct {
+ // Logger is the logger to use. If not set, a default logger will be used.
+ Logger *slog.Logger
+
+ // LogLevel defines the log level of the logger.
+ LogLevel slog.Level
+
+ // Handles errors that occur when writing to the log
+ ErrorHandler func(err error)
+}
+
+type Plugin struct {
+ config *Config
+ app *application.App
+ level slog.LevelVar
+}
+
+func NewPluginWithConfig(config *Config) *Plugin {
+ if config.Logger == nil {
+ config.Logger = application.DefaultLogger(config.LogLevel)
+ }
+
+ result := &Plugin{
+ config: config,
+ }
+ result.level.Set(config.LogLevel)
+ return result
+}
+
+func NewPlugin() *Plugin {
+ return NewPluginWithConfig(&Config{})
+}
+
+// Shutdown is called when the app is shutting down
+// You can use this to clean up any resources you have allocated
+func (p *Plugin) Shutdown() error { return nil }
+
+// Name returns the name of the plugin.
+// You should use the go module format e.g. github.com/myuser/myplugin
+func (p *Plugin) Name() string {
+ return "github.com/wailsapp/wails/v3/plugins/log"
+}
+
+func (p *Plugin) Init(api application.PluginAPI) error {
+ return nil
+}
+
+// CallableByJS returns a list of methods that can be called from the frontend
+func (p *Plugin) CallableByJS() []string {
+ return []string{
+ "Debug",
+ "Info",
+ "Warning",
+ "Error",
+ "SetLogLevel",
+ }
+}
+
+func (p *Plugin) Assets() fs.FS {
+ return assets
+}
+
+// ---------------- Plugin Methods ----------------
+// Plugin methods are just normal Go methods. You can add as many as you like.
+// The only requirement is that they are exported (start with a capital letter).
+// You can also return any type that is JSON serializable.
+// See https://golang.org/pkg/encoding/json/#Marshal for more information.
+
+func (p *Plugin) Debug(message string, args ...any) {
+ p.config.Logger.Debug(message, args...)
+}
+
+func (p *Plugin) Info(message string, args ...any) {
+ p.config.Logger.Info(message, args...)
+}
+
+func (p *Plugin) Warning(message string, args ...any) {
+ p.config.Logger.Warn(message, args...)
+}
+
+func (p *Plugin) Error(message string, args ...any) {
+ p.config.Logger.Error(message, args...)
+}
+
+func (p *Plugin) SetLogLevel(level slog.Level) {
+ p.level.Set(level)
+}
+Support#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Runtime#
+
+
+
+
+@wailsio/runtime packageUsing the
+@wailsio/runtime package#@wailsio/runtime package is a JavaScript package that provides access to the Wails runtime. It is used in by all
+the standard templates and is the recommended way to integrate the runtime into your application. By using the package,
+you will only include the parts of the runtime that you use.Using a pre-built version of the runtime#
+v3/examples. The pre-built version of the runtime can be generated using the
+following command:runtime.js (and runtime.debug.js) file in the current directory.
+This file can be used by your application by adding it to your assets directory (normally frontend/dist) and then including it in your HTML:
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Roadmap#
+Known Issues#
+
+
+Alpha milestones#
+Current: Alpha 5#
+Goals#
+How Can I Help?#
+
+
+Status#
+
+
+
+
+
+
+
+
+
+Example
+Linux
+
+
+binding
+
+
+
+build
+
+
+
+clipboard
+
+
+
+context menus
+
+
+
+dialogs
+
+
+
+drag-n-drop
+
+
+
+events
+
+
+
+frameless
+
+
+
+keybindings
+
+
+
+plain
+
+
+
+screen
+
+
+
+systray
+
+
+
+video
+
+
+
+window
+
+
+
+
+wml
+
+ Upcoming milestones#
+Alpha 6#
+Previous milestones#
+Alpha 4 - Completed 2024-02-01#
+Goals#
+dev and package commands.
+The wails dev command should do the following:
+- Build the application
+- Start the application
+- Start the frontend dev server
+- Watch for changes to the application code and rebuild/restart as necessarywails package command should do the following:
+- Build the application
+- Package the application in a platform specific format
+ - Windows: Standard executable, NSIS Installer
+ - Linux: AppImage
+ - MacOS: Standard executable, App Bundle
+- Support obfuscation of the application code
+
+How Can I Help?#
+
+
+wails3 doctor and ensure that all dependencies are installed. wails3 init.wails3 dev command:
+
+wails3 dev in the project directory. It should run the application in development mode.wails3 dev -help to view options.wails3 package command:
+
+wails3 package in the project directory.wails3 package -help to view options.Status#
+wails3 dev command:
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+
+
+
+
+wails3 dev
+
+
+
+
+wails3 package command:
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+
+
+Standard Executable
+
+
+
+
+
+macOS Application Bundle
+
+
+
+
+
+
+NSIS
+
+
+
+ Alpha 3 - Completed 2024-01-14#
+Goals#
+How Can I Help?#
+wails3 generate bindings command. This will generate bindings for all exported struct methods bound to your project.
+Run wails3 generate bindings -help to view options that govern how bindings are generated.testdata directory. v3/internal/parser. All tests can be run using go test ./... from the v3 directory.
+Basically, try to break it and let us know if you find any issues! Status#
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Same package
+
+
+
+
+
+Different package
+
+
+
+
+
+Different package with same name
+on hold
+on hold
+on hold
+
+
+Containing another struct from same package
+
+
+
+
+
+Containing another struct from different package
+
+
+
+
+
+
+Containing an anonymous struct
+
+
+
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Same package
+:material-check-bold
+
+
+
+
+Different package
+
+
+
+
+
+Different package with same name
+on hold
+on hold
+on hold
+
+
+Containing another struct from same package
+
+
+
+
+
+Containing another struct from different package
+
+
+
+
+
+
+Containing an anonymous struct
+
+
+
+
+
+
+
+
+
+
+
+
+Scenario
+Windows
+Mac
+Linux
+
+
+Class model for struct in same package
+
+
+
+
+
+Class model for struct in different package
+
+
+
+
+
+Interface model for struct in same package
+
+
+
+
+
+Interface model for struct in different package
+
+
+
+
+
+Enum in same package
+
+
+
+
+
+Enum in different package
+
+
+
+
+
+Interface using enum in same package
+
+
+
+
+
+
+Interface using enum in different package
+
+
+
+
+
+Alpha 2#
+Goals#
+Status#
+
+
+
+
+
+
+
+
+
+
+ Mac
+Windows
+Linux
+WSL
+
+
+
+wails init
+
+
+
+
+
+
+
+wails build
+
+
+
+ Alpha 1#
+Goals#
+Status#
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Linux
+Notes
+
+
+binding
+
+
+
+
+build
+
+
+
+
+clipboard
+
+
+
+
+context menus
+
+
+
+
+dialogs
+
+
+
+
+drag-n-drop
+
+
+
+
+events
+
+
+
+
+frameless
+
+
+
+
+keybindings
+
+
+
+
+plain
+
+
+
+
+screen
+
+
+
+
+systray
+
+
+
+
+video
+
+
+
+
+window
+
+
+
+
+
+wml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ What's New in Wails v3 Alpha#
+Multiple Windows#
+package main
+
+import (
+ _ "embed"
+ "log"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+)
+
+//go:embed assets/*
+var assets embed.FS
+
+func main() {
+
+ app := application.New(application.Options{
+ Name: "Multi Window Demo",
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ })
+
+ window1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Window 1",
+ })
+
+ window2 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Window 2",
+ })
+
+ // load the embedded html from the embed.FS
+ window1.SetURL("/")
+ window1.Center()
+
+ // Load an external URL
+ window2.SetURL("https://wails.app")
+
+ err := app.Run()
+
+ if err != nil {
+ log.Fatal(err.Error())
+ }
+}
+Systrays#
+
+
+package main
+
+import (
+ _ "embed"
+ "log"
+ "runtime"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "github.com/wailsapp/wails/v3/pkg/icons"
+)
+
+func main() {
+ app := application.New(application.Options{
+ Name: "Systray Demo",
+ Mac: application.MacOptions{
+ ActivationPolicy: application.ActivationPolicyAccessory,
+ },
+ })
+
+ window := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Width: 500,
+ Height: 800,
+ Frameless: true,
+ AlwaysOnTop: true,
+ Hidden: true,
+ Windows: application.WindowsWindow{
+ HiddenOnTaskbar: true,
+ },
+ })
+
+ systemTray := app.NewSystemTray()
+
+ // Support for template icons on macOS
+ if runtime.GOOS == "darwin" {
+ systemTray.SetTemplateIcon(icons.SystrayMacTemplate)
+ } else {
+ // Support for light/dark mode icons
+ systemTray.SetDarkModeIcon(icons.SystrayDark)
+ systemTray.SetIcon(icons.SystrayLight)
+ }
+
+ // Support for menu
+ myMenu := app.NewMenu()
+ myMenu.Add("Hello World!").OnClick(func(_ *application.Context) {
+ println("Hello World!")
+ })
+ systemTray.SetMenu(myMenu)
+
+ // This will center the window to the systray icon with a 5px offset
+ // It will automatically be shown when the systray icon is clicked
+ // and hidden when the window loses focus
+ systemTray.AttachWindow(window).WindowOffset(5)
+
+ err := app.Run()
+ if err != nil {
+ log.Fatal(err)
+ }
+}
+Plugins#
+
+
+Improved bindings generation#
+wails3 generate bindings in the
+project directory.// @ts-check
+// Cynhyrchwyd y ffeil hon yn awtomatig. PEIDIWCH Â MODIWL
+// This file is automatically generated. DO NOT EDIT
+
+import { main } from "./models";
+
+window.go = window.go || {};
+window.go.main = {
+ GreetService: {
+ /**
+ * GreetService.Greet
+ * Greet greets a person
+ * @param name {string}
+ * @returns {Promise<string>}
+ **/
+ Greet: function (name) {
+ wails.CallByID(1411160069, ...Array.prototype.slice.call(arguments, 0));
+ },
+
+ /**
+ * GreetService.GreetPerson
+ * GreetPerson greets a person
+ * @param person {main.Person}
+ * @returns {Promise<string>}
+ **/
+ GreetPerson: function (person) {
+ wails.CallByID(4021313248, ...Array.prototype.slice.call(arguments, 0));
+ },
+ },
+};
+Improved build system#
+build:darwin:
+ summary: Builds the application
+ platforms:
+ - darwin
+ cmds:
+ - task: pre-build
+ - task: build-frontend
+ - go build -gcflags=all="-N -l" -o bin/{{.APP_NAME}}
+ - task: post-build
+ env:
+ CGO_CFLAGS: "-mmacosx-version-min=10.13"
+ CGO_LDFLAGS: "-mmacosx-version-min=10.13"
+ MACOSX_DEPLOYMENT_TARGET: "10.13"
+Improved events#
+On method but are
+synchronous and allow you to cancel the event. An example of this would be to
+show a confirmation dialog before closing a window.package main
+
+import (
+ _ "embed"
+ "log"
+ "time"
+
+ "github.com/wailsapp/wails/v3/pkg/application"
+ "github.com/wailsapp/wails/v3/pkg/events"
+)
+
+//go:embed assets
+var assets embed.FS
+
+func main() {
+
+ app := application.New(application.Options{
+ Name: "Events Demo",
+ Description: "A demo of the Events API",
+ Assets: application.AssetOptions{
+ Handler: application.AssetFileServerFS(assets),
+ },
+ Mac: application.MacOptions{
+ ApplicationShouldTerminateAfterLastWindowClosed: true,
+ },
+ })
+
+ // Custom event handling
+ app.Events.On("myevent", func(e *application.WailsEvent) {
+ log.Printf("[Go] WailsEvent received: %+v\n", e)
+ })
+
+ // OS specific application events
+ app.On(events.Mac.ApplicationDidFinishLaunching, func(event *application.Event) {
+ println("events.Mac.ApplicationDidFinishLaunching fired!")
+ })
+
+ // Platform agnostic events
+ app.On(events.Common.ApplicationStarted, func(event *application.Event) {
+ println("events.Common.ApplicationStarted fired!")
+ })
+
+ win1 := app.NewWebviewWindowWithOptions(application.WebviewWindowOptions{
+ Title: "Takes 3 attempts to close me!",
+ })
+
+ var countdown = 3
+
+ // Register a hook to cancel the window closing
+ win1.RegisterHook(events.Common.WindowClosing, func(e *application.WindowEvent) {
+ countdown--
+ if countdown == 0 {
+ println("Closing!")
+ return
+ }
+ println("Nope! Not closing!")
+ e.Cancel()
+ })
+
+ win1.On(events.Common.WindowFocus, func(e *application.WindowEvent) {
+ println("[Event] Window focus!")
+ })
+
+ err := app.Run()
+
+ if err != nil {
+ log.Fatal(err.Error())
+ }
+}
+Wails Markup Language (wml)#
+<!doctype html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <title>Wails ML Demo</title>
+ </head>
+ <body style="margin-top:50px; color: white; background-color: #191919">
+ <h2>Wails ML Demo</h2>
+ <p>This application contains no Javascript!</p>
+ <button wml-event="button-pressed">Press me!</button>
+ <button wml-event="delete-things" wml-confirm="Are you sure?">
+ Delete all the things!
+ </button>
+ <button wml-window="Close" wml-confirm="Are you sure?">
+ Close the Window?
+ </button>
+ <button wml-window="Center">Center</button>
+ <button wml-window="Minimise">Minimise</button>
+ <button wml-window="Maximise">Maximise</button>
+ <button wml-window="UnMaximise">UnMaximise</button>
+ <button wml-window="Fullscreen">Fullscreen</button>
+ <button wml-window="UnFullscreen">UnFullscreen</button>
+ <button wml-window="Restore">Restore</button>
+ <div
+ style="width: 200px; height: 200px; border: 2px solid white;"
+ wml-event="hover"
+ wml-trigger="mouseover"
+ >
+ Hover over me
+ </div>
+ </body>
+</html>
+Examples#
+