Skip to main content
Version: Следующая версия 🚧

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)
JS: WindowSetTitle(title: string)

WindowFullscreen

Makes the window full screen.

Go: WindowFullscreen(ctx context.Context)
JS: WindowFullscreen()

WindowUnfullscreen

Restores the previous window dimensions and position prior to full screen.

Go: WindowUnfullscreen(ctx context.Context)
JS: WindowUnfullscreen()

WindowIsFullscreen

Returns true if the window is full screen.

Go: WindowCenter(ctx context.Context)
JS: WindowCenter()

WindowCenter

Centers the window on the monitor the window is currently on.

Go: WindowReload(ctx context.Context)
JS: WindowReload()

WindowReload

Performs a "reload" (Reloads current page).

Go: WindowReloadApp(ctx context.Context)
JS: WindowReloadApp()

WindowReloadApp

Reloads the application frontend.

Go: WindowSetSystemDefaultTheme(ctx context.Context)
JS: WindowSetSystemDefaultTheme()

WindowSetSystemDefaultTheme

Windows only.

Go: WindowSetDarkTheme(ctx context.Context)
JS: WindowSetDarkTheme()

Sets window theme to system default (dark/light).

WindowSetLightTheme

Windows only.

Go: WindowSetLightTheme(ctx context.Context)
JS: WindowSetLightTheme()

Sets window theme to light.

WindowSetDarkTheme

Windows only.

Go: WindowShow(ctx context.Context)
JS: WindowShow()

Sets window theme to dark.

WindowShow

Shows the window, if it is currently hidden.

Go: WindowHide(ctx context.Context)
JS: WindowHide()

WindowHide

Hides the window, if it is currently visible.

Go: WindowSetSize(ctx context.Context, width int, height int)
JS: WindowSetSize(size: Size)

WindowIsNormal

Returns true if the window not minimised, maximised or fullscreen.

Go: WindowGetSize(ctx context.Context) (width int, height int)
JS: WindowGetSize() : Size

WindowSetSize

Sets the width and height of the window.

Go: WindowSetMaxSize(ctx context.Context, width int, height int)
JS: WindowSetMaxSize(size: Size)

WindowGetSize

Gets the width and height of the window.

Go: WindowSetMinSize(ctx context.Context, width int, height int)
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)
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)
JS: WindowSetPosition(position: Position)

WindowSetAlwaysOnTop

Sets the window AlwaysOnTop or not on top.

Go: WindowGetPosition(ctx context.Context) (x int, y int)
JS: WindowGetPosition() : Position

WindowSetPosition

Sets the window position relative to the monitor the window is currently on.

Go: WindowMaximise(ctx context.Context)
JS: WindowMaximise()

WindowGetPosition

Gets the window position relative to the monitor the window is currently on.

Go: WindowUnmaximise(ctx context.Context)
JS: WindowUnmaximise()

WindowMaximise

Maximises the window to fill the screen.

Go: WindowToggleMaximise(ctx context.Context)
JS: WindowToggleMaximise()

WindowUnmaximise

Restores the window to the dimensions and position prior to maximising.

Go: WindowMinimise(ctx context.Context)
JS: WindowMinimise()

WindowIsMaximised

Returns true if the window is maximised.

Go: WindowUnminimise(ctx context.Context)
JS: WindowUnminimise()

WindowToggleMaximise

Toggles between Maximised and UnMaximised.

Go: WindowToggleMaximise(ctx context.Context)
JS: WindowToggleMaximise()

WindowMinimise

Minimises the window.

Go: WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)
JS: WindowSetBackgroundColour(R, G, B, A)

WindowUnminimise

Restores the window to the dimensions and position prior to minimising.

Go: WindowUnminimise(ctx context.Context)
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. :::info Windows On Windows, only alpha values of 0 or 255 are supported. :::

Go: WindowSetBackgroundColour(ctx context.Context, R, G, B, A uint8)
JS: WindowSetBackgroundColour(R, G, B, A)

Typescript Object Definitions

Position

interface Position {
x: number;
y: number;
}

Size

interface Size {
w: number;
h: number;
}