mirror of
https://github.com/wailsapp/wails.git
synced 2026-03-14 14:45:49 +01:00
* New translations markdown-page.md (Acholi) [ci skip] * New translations stats.mdx (Acholi) [ci skip] * New translations code.json (Acholi) [ci skip] * New translations options.json (Acholi) [ci skip] * New translations current.json (Acholi) [ci skip] * New translations version-v2.0.0-beta.43.json (Acholi) [ci skip] * New translations helloworld.mdx (Acholi) [ci skip] * New translations footer.json (Acholi) [ci skip] * New translations navbar.json (Acholi) [ci skip] * New translations emailit.mdx (Acholi) [ci skip] * New translations modalfilemanager.mdx (Acholi) [ci skip] * New translations linux.mdx (Acholi) [ci skip] * New translations scriptbar.mdx (Acholi) [ci skip] * New translations minecraftupdater.mdx (Acholi) [ci skip] * New translations faq.mdx (Acholi) [ci skip] * New translations community-guide.mdx (Acholi) [ci skip] * New translations vscode.mdx (Acholi) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations templates.mdx (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations troubleshooting.mdx (Acholi) [ci skip] * New translations windows-installer.mdx (Acholi) [ci skip] * New translations windows.mdx (Acholi) [ci skip] * New translations howdoesitwork.mdx (Acholi) [ci skip] * New translations introduction.mdx (Acholi) [ci skip] * New translations cli.mdx (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations window.mdx (Acholi) [ci skip] * New translations menus.mdx (Acholi) [ci skip] * New translations options.mdx (Acholi) [ci skip] * New translations project-config.mdx (Acholi) [ci skip] * New translations _category_.json (Acholi) [ci skip] * New translations browser.mdx (Acholi) [ci skip] * New translations dialog.mdx (Acholi) [ci skip] * New translations events.mdx (Acholi) [ci skip] * New translations intro.mdx (Acholi) [ci skip] * New translations log.mdx (Acholi) [ci skip] * New translations menu.mdx (Acholi) [ci skip] * New translations dogsapi.mdx (Acholi) [ci skip] * New translations templates.mdx (Chinese Simplified) [ci skip] * New translations templates.mdx (Russian) [ci skip] * New translations templates.mdx (Japanese) [ci skip] * New translations templates.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations templates.mdx (Acholi) [ci skip] * New translations encrypteasy.mdx (Japanese) [ci skip] * New translations wally.mdx (Korean) [ci skip] * New translations wally.mdx (Japanese) [ci skip] * New translations wally.mdx (Russian) [ci skip] * New translations wally.mdx (Chinese Simplified) [ci skip] * New translations wombat.mdx (Japanese) [ci skip] * New translations wombat.mdx (Korean) [ci skip] * New translations wombat.mdx (Russian) [ci skip] * New translations wombat.mdx (Chinese Simplified) [ci skip] * New translations ytd.mdx (Japanese) [ci skip] * New translations ytd.mdx (Korean) [ci skip] * New translations ytd.mdx (Russian) [ci skip] * New translations ytd.mdx (Chinese Simplified) [ci skip] * New translations encrypteasy.mdx (Korean) [ci skip] * New translations october.mdx (Japanese) [ci skip] * New translations encrypteasy.mdx (Russian) [ci skip] * New translations encrypteasy.mdx (Chinese Simplified) [ci skip] * New translations filehound.mdx (Japanese) [ci skip] * New translations filehound.mdx (Korean) [ci skip] * New translations filehound.mdx (Russian) [ci skip] * New translations filehound.mdx (Chinese Simplified) [ci skip] * New translations mollywallet.mdx (Japanese) [ci skip] * New translations mollywallet.mdx (Korean) [ci skip] * New translations mollywallet.mdx (Russian) [ci skip] * New translations mollywallet.mdx (Chinese Simplified) [ci skip] * New translations october.mdx (Korean) [ci skip] * New translations october.mdx (Russian) [ci skip] * New translations october.mdx (Chinese Simplified) [ci skip] * New translations optimus.mdx (Japanese) [ci skip] * New translations optimus.mdx (Korean) [ci skip] * New translations optimus.mdx (Russian) [ci skip] * New translations optimus.mdx (Chinese Simplified) [ci skip] * New translations portfall.mdx (Japanese) [ci skip] * New translations portfall.mdx (Korean) [ci skip] * New translations portfall.mdx (Russian) [ci skip] * New translations portfall.mdx (Chinese Simplified) [ci skip] * New translations scriptbar.mdx (Russian) [ci skip] * New translations emailit.mdx (Japanese) [ci skip] * New translations emailit.mdx (Korean) [ci skip] * New translations emailit.mdx (Russian) [ci skip] * New translations emailit.mdx (Chinese Simplified) [ci skip] * New translations modalfilemanager.mdx (Japanese) [ci skip] * New translations modalfilemanager.mdx (Korean) [ci skip] * New translations modalfilemanager.mdx (Russian) [ci skip] * New translations modalfilemanager.mdx (Chinese Simplified) [ci skip] * New translations scriptbar.mdx (Japanese) [ci skip] * New translations scriptbar.mdx (Korean) [ci skip] * New translations scriptbar.mdx (Chinese Simplified) [ci skip] * New translations minecraftupdater.mdx (Japanese) [ci skip] * New translations minecraftupdater.mdx (Korean) [ci skip] * New translations minecraftupdater.mdx (Russian) [ci skip] * New translations minecraftupdater.mdx (Chinese Simplified) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations optimus.mdx (Acholi) [ci skip] * New translations portfall.mdx (Acholi) [ci skip] * New translations wally.mdx (Acholi) [ci skip] * New translations october.mdx (Acholi) [ci skip] * New translations mollywallet.mdx (Acholi) [ci skip] * New translations filehound.mdx (Acholi) [ci skip] * New translations encrypteasy.mdx (Acholi) [ci skip] * New translations wombat.mdx (Acholi) [ci skip] * New translations ytd.mdx (Acholi) [ci skip] * New translations scriptbar.mdx (Acholi) [ci skip] * New translations minecraftupdater.mdx (Acholi) [ci skip] * New translations modalfilemanager.mdx (Acholi) [ci skip] * New translations emailit.mdx (Acholi) [ci skip] * New translations troubleshooting.mdx (Japanese) [ci skip] * New translations troubleshooting.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Russian) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations troubleshooting.mdx (Acholi) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations building.mdx (Japanese) [ci skip] * New translations 2021-11-08-v2-beta2-release-notes.mdx (Japanese) [ci skip] * New translations howdoesitwork.mdx (Chinese Simplified) [ci skip] * New translations introduction.mdx (Japanese) [ci skip] * New translations introduction.mdx (Korean) [ci skip] * New translations introduction.mdx (Russian) [ci skip] * New translations introduction.mdx (Chinese Simplified) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Japanese) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Korean) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Russian) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Chinese Simplified) [ci skip] * New translations 2021-11-08-v2-beta2-release-notes.mdx (Korean) [ci skip] * New translations howdoesitwork.mdx (Korean) [ci skip] * New translations 2021-11-08-v2-beta2-release-notes.mdx (Russian) [ci skip] * New translations 2021-11-08-v2-beta2-release-notes.mdx (Chinese Simplified) [ci skip] * New translations 2022-02-22-v2-beta3-release-notes.mdx (Japanese) [ci skip] * New translations 2022-02-22-v2-beta3-release-notes.mdx (Korean) [ci skip] * New translations 2022-02-22-v2-beta3-release-notes.mdx (Russian) [ci skip] * New translations 2022-02-22-v2-beta3-release-notes.mdx (Chinese Simplified) [ci skip] * New translations dogsapi.mdx (Japanese) [ci skip] * New translations dogsapi.mdx (Korean) [ci skip] * New translations dogsapi.mdx (Russian) [ci skip] * New translations dogsapi.mdx (Chinese Simplified) [ci skip] * New translations howdoesitwork.mdx (Russian) [ci skip] * New translations howdoesitwork.mdx (Japanese) [ci skip] * New translations building.mdx (Korean) [ci skip] * New translations ides.mdx (Chinese Simplified) [ci skip] * New translations building.mdx (Russian) [ci skip] * New translations building.mdx (Chinese Simplified) [ci skip] * New translations installation.mdx (Korean) [ci skip] * New translations dynamic-assets.mdx (Japanese) [ci skip] * New translations dynamic-assets.mdx (Korean) [ci skip] * New translations dynamic-assets.mdx (Russian) [ci skip] * New translations dynamic-assets.mdx (Chinese Simplified) [ci skip] * New translations ides.mdx (Japanese) [ci skip] * New translations ides.mdx (Korean) [ci skip] * New translations ides.mdx (Russian) [ci skip] * New translations windows-installer.mdx (Japanese) [ci skip] * New translations helloworld.mdx (Chinese Simplified) [ci skip] * New translations windows-installer.mdx (Korean) [ci skip] * New translations windows-installer.mdx (Russian) [ci skip] * New translations windows-installer.mdx (Chinese Simplified) [ci skip] * New translations options.mdx (Japanese) [ci skip] * New translations options.mdx (Korean) [ci skip] * New translations options.mdx (Russian) [ci skip] * New translations options.mdx (Chinese Simplified) [ci skip] * New translations helloworld.mdx (Japanese) [ci skip] * New translations helloworld.mdx (Korean) [ci skip] * New translations helloworld.mdx (Russian) [ci skip] * New translations building.mdx (Acholi) [ci skip] * New translations dynamic-assets.mdx (Acholi) [ci skip] * New translations ides.mdx (Acholi) [ci skip] * New translations windows-installer.mdx (Acholi) [ci skip] * New translations howdoesitwork.mdx (Acholi) [ci skip] * New translations introduction.mdx (Acholi) [ci skip] * New translations options.mdx (Acholi) [ci skip] * New translations helloworld.mdx (Acholi) [ci skip] * New translations 2021-09-27-v2-beta1-release-notes.mdx (Acholi) [ci skip] * New translations 2021-11-08-v2-beta2-release-notes.mdx (Acholi) [ci skip] * New translations 2022-02-22-v2-beta3-release-notes.mdx (Acholi) [ci skip] * New translations dogsapi.mdx (Acholi) [ci skip] * New translations troubleshooting.mdx (Japanese) [ci skip] * New translations troubleshooting.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Russian) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations window.mdx (Japanese) [ci skip] * New translations window.mdx (Korean) [ci skip] * New translations window.mdx (Russian) [ci skip] * New translations window.mdx (Chinese Simplified) [ci skip] * New translations troubleshooting.mdx (Acholi) [ci skip] * New translations window.mdx (Acholi) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations installation.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Japanese) [ci skip] * New translations troubleshooting.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Russian) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations window.mdx (Japanese) [ci skip] * New translations window.mdx (Korean) [ci skip] * New translations window.mdx (Russian) [ci skip] * New translations window.mdx (Chinese Simplified) [ci skip] * New translations navbar.json (Japanese) [ci skip] * New translations troubleshooting.mdx (Acholi) [ci skip] * New translations navbar.json (Chinese Simplified) [ci skip] * New translations navbar.json (Russian) [ci skip] * New translations navbar.json (Korean) [ci skip] * New translations navbar.json (Acholi) [ci skip] * New translations events.mdx (Japanese) [ci skip] * New translations events.mdx (Korean) [ci skip] * New translations events.mdx (Russian) [ci skip] * New translations events.mdx (Chinese Simplified) [ci skip] * New translations events.mdx (Acholi) [ci skip] * New translations howdoesitwork.mdx (Japanese) [ci skip] * New translations building.mdx (Korean) [ci skip] * New translations development.mdx (Korean) [ci skip] * New translations overscroll.mdx (Japanese) [ci skip] * New translations overscroll.mdx (Korean) [ci skip] * New translations overscroll.mdx (Russian) [ci skip] * New translations overscroll.mdx (Chinese Simplified) [ci skip] * New translations introduction.mdx (Korean) [ci skip] * New translations overscroll.mdx (Acholi) [ci skip] * New translations bleeding-edge.mdx (Japanese) [ci skip] * New translations bleeding-edge.mdx (Korean) [ci skip] * New translations bleeding-edge.mdx (Russian) [ci skip] * New translations bleeding-edge.mdx (Chinese Simplified) [ci skip] * New translations bleeding-edge.mdx (Acholi) [ci skip] * New translations introduction.mdx (Korean) [ci skip] * New translations introduction.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Japanese) [ci skip] * New translations troubleshooting.mdx (Korean) [ci skip] * New translations troubleshooting.mdx (Russian) [ci skip] * New translations troubleshooting.mdx (Chinese Simplified) [ci skip] * New translations howdoesitwork.mdx (Japanese) [ci skip] * New translations troubleshooting.mdx (Acholi) [ci skip] * New translations frameless.mdx (Japanese) [ci skip] * New translations frameless.mdx (Korean) [ci skip] * New translations frameless.mdx (Russian) [ci skip] * New translations frameless.mdx (Chinese Simplified) [ci skip] * New translations options.mdx (Japanese) [ci skip] * New translations options.mdx (Korean) [ci skip] * New translations options.mdx (Russian) [ci skip] * New translations options.mdx (Chinese Simplified) [ci skip] * New translations frameless.mdx (Acholi) [ci skip] * New translations options.mdx (Acholi) [ci skip] * Fix issues again
209 lines
5.1 KiB
Text
209 lines
5.1 KiB
Text
---
|
|
sidebar_position: 4
|
|
---
|
|
|
|
# Window
|
|
|
|
These methods give control of the application window.
|
|
|
|
### WindowSetTitle
|
|
|
|
Sets the text in the window title bar.
|
|
|
|
Go: `WindowSetTitle(ctx context.Context, title string)`<br/> JS: `WindowSetTitle(title: string)`
|
|
|
|
### WindowFullscreen
|
|
|
|
Makes the window full screen.
|
|
|
|
Go: `WindowFullscreen(ctx context.Context)`<br/> JS: `WindowFullscreen()`
|
|
|
|
### WindowUnfullscreen
|
|
|
|
Restores the previous window dimensions and position prior to full screen.
|
|
|
|
Go: `WindowUnfullscreen(ctx context.Context)`<br/> JS: `WindowUnfullscreen()`
|
|
|
|
### WindowIsFullscreen
|
|
|
|
Returns true if the window is full screen.
|
|
|
|
Go: `WindowCenter(ctx context.Context)`<br/> JS: `WindowCenter()`
|
|
|
|
### WindowCenter
|
|
|
|
Centers the window on the monitor the window is currently on.
|
|
|
|
Go: `WindowReload(ctx context.Context)`<br/> JS: `WindowReload()`
|
|
|
|
### WindowReload
|
|
|
|
Performs a "reload" (Reloads current page).
|
|
|
|
Go: `WindowReloadApp(ctx context.Context)`<br/> JS: `WindowReloadApp()`
|
|
|
|
### WindowReloadApp
|
|
|
|
Reloads the application frontend.
|
|
|
|
Go: `WindowSetSystemDefaultTheme(ctx context.Context)`<br/> JS: `WindowSetSystemDefaultTheme()`
|
|
|
|
### WindowSetSystemDefaultTheme
|
|
|
|
Windows only.
|
|
|
|
Go: `WindowSetDarkTheme(ctx context.Context)`<br/> JS: `WindowSetDarkTheme()`
|
|
|
|
Sets window theme to system default (dark/light).
|
|
|
|
### WindowSetLightTheme
|
|
|
|
Windows only.
|
|
|
|
Go: `WindowSetLightTheme(ctx context.Context)`<br/> JS: `WindowSetLightTheme()`
|
|
|
|
Sets window theme to light.
|
|
|
|
### WindowSetDarkTheme
|
|
|
|
Windows only.
|
|
|
|
Go: `WindowShow(ctx context.Context)`<br/> JS: `WindowShow()`
|
|
|
|
Sets window theme to dark.
|
|
|
|
### WindowShow
|
|
|
|
Shows the window, if it is currently hidden.
|
|
|
|
Go: `WindowHide(ctx context.Context)`<br/> JS: `WindowHide()`
|
|
|
|
### WindowHide
|
|
|
|
Hides the window, if it is currently visible.
|
|
|
|
Go: `WindowSetSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetSize(size: Size)`
|
|
|
|
### WindowIsNormal
|
|
|
|
Returns true if the window not minimised, maximised or fullscreen.
|
|
|
|
Go: `WindowGetSize(ctx context.Context) (width int, height int)`<br/> JS: `WindowGetSize() : Size`
|
|
|
|
### WindowSetSize
|
|
|
|
Sets the width and height of the window.
|
|
|
|
Go: `WindowSetMaxSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMaxSize(size: Size)`
|
|
|
|
### WindowGetSize
|
|
|
|
Gets the width and height of the window.
|
|
|
|
Go: `WindowSetMinSize(ctx context.Context, width int, height int)`<br/> JS: `WindowSetMinSize(size: Size)`
|
|
|
|
### WindowSetMinSize
|
|
|
|
Sets the minimum window size. Will resize the window if the window is currently smaller than the given dimensions.
|
|
|
|
Setting a size of `0,0` will disable this constraint.
|
|
|
|
Go: `WindowSetAlwaysOnTop(ctx context.Context, b bool)`<br/> JS: `WindowSetAlwaysOnTop(b: Boolen)`
|
|
|
|
### WindowSetMaxSize
|
|
|
|
Sets the maximum window size. Will resize the window if the window is currently larger than the given dimensions.
|
|
|
|
Setting a size of `0,0` will disable this constraint.
|
|
|
|
Go: `WindowSetPosition(ctx context.Context, x int, y int)`<br/> JS: `WindowSetPosition(position: Position)`
|
|
|
|
### WindowSetAlwaysOnTop
|
|
|
|
Sets the window AlwaysOnTop or not on top.
|
|
|
|
Go: `WindowGetPosition(ctx context.Context) (x int, y int)`<br/> JS: `WindowGetPosition() : Position`
|
|
|
|
### WindowSetPosition
|
|
|
|
Sets the window position relative to the monitor the window is currently on.
|
|
|
|
Go: `WindowMaximise(ctx context.Context)`<br/> JS: `WindowMaximise()`
|
|
|
|
### WindowGetPosition
|
|
|
|
Gets the window position relative to the monitor the window is currently on.
|
|
|
|
Go: `WindowUnmaximise(ctx context.Context)`<br/> JS: `WindowUnmaximise()`
|
|
|
|
### WindowMaximise
|
|
|
|
Maximises the window to fill the screen.
|
|
|
|
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
|
|
|
### WindowUnmaximise
|
|
|
|
Restores the window to the dimensions and position prior to maximising.
|
|
|
|
Go: `WindowMinimise(ctx context.Context)`<br/> JS: `WindowMinimise()`
|
|
|
|
### WindowIsMaximised
|
|
|
|
Returns true if the window is maximised.
|
|
|
|
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
|
|
|
|
### WindowToggleMaximise
|
|
|
|
Toggles between Maximised and UnMaximised.
|
|
|
|
Go: `WindowToggleMaximise(ctx context.Context)`<br/> JS: `WindowToggleMaximise()`
|
|
|
|
### WindowMinimise
|
|
|
|
Minimises the window.
|
|
|
|
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
|
|
|
### WindowUnminimise
|
|
|
|
Restores the window to the dimensions and position prior to minimising.
|
|
|
|
Go: `WindowUnminimise(ctx context.Context)`<br/> JS: `WindowUnminimise()`
|
|
|
|
### WindowIsMinimised
|
|
|
|
Returns true if the window is minimised.
|
|
|
|
Go: `WindowIsMinimised(ctx context.Context) bool` JS: `WindowIsMinimised() bool`
|
|
|
|
### WindowSetBackgroundColour
|
|
|
|
Sets the background colour of the window to the given RGBA colour definition. This colour will show through for all transparent pixels.
|
|
|
|
Valid values for R, G, B and A are 0-255.
|
|
|
|
Any value that is not 0 will be considered 255. Any value that is not 0 will be considered 255. :::
|
|
|
|
Go: `WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)`<br/> JS: `WindowSetBackgroundColour(R, G, B, A)`
|
|
|
|
## Typescript Object Definitions
|
|
|
|
### Position
|
|
|
|
```ts
|
|
interface Position {
|
|
x: number;
|
|
y: number;
|
|
}
|
|
```
|
|
|
|
### Size
|
|
|
|
```ts
|
|
interface Size {
|
|
w: number;
|
|
h: number;
|
|
}
|
|
```
|