Skip to main content
Version: v2.0.0-beta.43

Window

Overviewโ€‹

These methods give control of the application window.

WindowSetTitleโ€‹

Go Signature: WindowSetTitle(ctx context.Context, title string)

JS Signature: WindowSetTitle(title: string)

Sets the text in the window title bar.

WindowFullscreenโ€‹

Go Signature: WindowFullscreen(ctx context.Context)

JS Signature: WindowFullscreen()

Makes the window full screen.

WindowUnfullscreenโ€‹

Go Signature: WindowUnfullscreen(ctx context.Context)

JS Signature: WindowUnfullscreen()

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

WindowCenterโ€‹

Go Signature: WindowCenter(ctx context.Context)

JS Signature: WindowCenter()

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

WindowReloadโ€‹

Go Signature: WindowReload(ctx context.Context)

JS Signature: WindowReload()

Performs a "reload" (Reloads current page).

WindowReloadAppโ€‹

Go Signature: WindowReloadApp(ctx context.Context)

JS Signature: WindowReloadApp()

Reloads the application frontend.

WindowSetSyโ€‹

WindowSetSystemDefaultThemeโ€‹

Go Signature: WindowSetSystemDefaultTheme(ctx context.Context)

JS Signature: WindowSetSystemDefaultTheme()

Windows only.

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

WindowSetLightThemeโ€‹

Go Signature: WindowSetLightTheme(ctx context.Context)

JS Signature: WindowSetLightTheme()

Windows only.

Sets window theme to light.

WindowSetDarkThemeโ€‹

Go Signature: WindowSetDarkTheme(ctx context.Context)

JS Signature: WindowSetDarkTheme()

Windows only.

Sets window theme to dark.

WindowShowโ€‹

Go Signature: WindowShow(ctx context.Context)

JS Signature: WindowShow()

Shows the window, if it is currently hidden.

WindowHideโ€‹

Go Signature: WindowHide(ctx context.Context)

JS Signature: WindowHide()

Hides the window, if it is currently visible.

WindowSetSizeโ€‹

Go Signature: WindowSetSize(ctx context.Context, width int, height int)

JS Signature: WindowSetSize(size: Size)

Sets the width and height of the window.

WindowGetSizeโ€‹

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

JS Signature: WindowGetSize() : Size

Gets the width and height of the window.

WindowSetMinSizeโ€‹

Go Signature: WindowSetMinSize(ctx context.Context, width int, height int)

JS Signature: WindowSetMinSize(size: Size)

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.

WindowSetMaxSizeโ€‹

Go Signature: WindowSetMaxSize(ctx context.Context, width int, height int)

JS Signature: WindowSetMaxSize(size: Size)

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.

WindowSetAlwaysOnTopโ€‹

Go Signature: WindowSetAlwaysOnTop(ctx context.Context, b bool)

JS Signature: WindowSetAlwaysOnTop(b: Boolen)

Sets the window AlwaysOnTop or not on top.

WindowSetPositionโ€‹

Go Signature: WindowSetPosition(ctx context.Context, x int, y int)

JS Signature: WindowSetPosition(position: Position)

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

WindowGetPositionโ€‹

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

JS Signature: WindowGetPosition() : Position

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

WindowMaximiseโ€‹

Go Signature: WindowMaximise(ctx context.Context)

JS Signature: WindowMaximise()

Maximises the window to fill the screen.

WindowUnmaximiseโ€‹

Go Signature: WindowUnmaximise(ctx context.Context)

JS Signature: WindowUnmaximise()

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

WindowToggleMaximiseโ€‹

Go Signature: WindowToggleMaximise(ctx context.Context)

JS Signature: WindowToggleMaximise()

Toggles between Maximised and UnMaximised.

WindowMinimiseโ€‹

Go Signature: WindowMinimise(ctx context.Context)

JS Signature: WindowMinimise()

Minimises the window.

WindowUnminimiseโ€‹

Go Signature: WindowUnminimise(ctx context.Context)

JS Signature: WindowUnminimise()

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

WindowSetBackgroundColourโ€‹

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

JS Signature: WindowSetBackgroundColour(R, G, B, A)

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.

Windows

On Windows, only alpha values of 0 or 255 are supported. Any value that is not 0 will be considered 255.

Typescript Object Definitionsโ€‹

Positionโ€‹

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

Sizeโ€‹

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