---
title: "Window"
---
Defined in: [api/node/typescript/index.ts:90](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L90)

This type represents a window towards the windowing system, that's used to render the
scene of a component. It provides API to control windowing system specific aspects such
as the position on the screen.

## Properties

### fullscreen

> **fullscreen**: `boolean`

Defined in: [api/node/typescript/index.ts:104](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L104)

Gets or sets the window's fullscreen state.

***

### logicalPosition

> **logicalPosition**: [`Point`](/latest/docs/node/api/interfaces/point/)

Defined in: [api/node/typescript/index.ts:92](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L92)

Gets or sets the logical position of the window on the screen.

***

### logicalSize

> **logicalSize**: [`Size`](/latest/docs/node/api/interfaces/size/)

Defined in: [api/node/typescript/index.ts:98](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L98)

Gets or sets the logical size of the window on the screen,

***

### maximized

> **maximized**: `boolean`

Defined in: [api/node/typescript/index.ts:107](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L107)

Gets or sets the window's maximized state.

***

### minimized

> **minimized**: `boolean`

Defined in: [api/node/typescript/index.ts:110](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L110)

Gets or sets the window's minimized state.

***

### physicalPosition

> **physicalPosition**: [`Point`](/latest/docs/node/api/interfaces/point/)

Defined in: [api/node/typescript/index.ts:95](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L95)

Gets or sets the physical position of the window on the screen.

***

### physicalSize

> **physicalSize**: [`Size`](/latest/docs/node/api/interfaces/size/)

Defined in: [api/node/typescript/index.ts:101](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L101)

Gets or sets the physical size of the window on the screen,

## Accessors

### visible

#### Get Signature

> **get** **visible**(): `boolean`

Defined in: [api/node/typescript/index.ts:116](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L116)

Returns the visibility state of the window. This function can return false even if you previously called show()
on it, for example if the user minimized the window.

##### Returns

`boolean`

## Methods

### dispatchEvent()

> **dispatchEvent**(`event`): [`WindowEventDispatchResult`](/latest/docs/node/api/slint-ui/namespaces/platform/enumerations/windoweventdispatchresult/)

Defined in: [api/node/typescript/index.ts:150](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L150)

Dispatches a window event to the scene.

Returns whether the scene accepted the event or rejected it.

#### Parameters

##### event

[`WindowEvent`](/latest/docs/node/api/slint-ui/namespaces/platform/type-aliases/windowevent/)

#### Returns

[`WindowEventDispatchResult`](/latest/docs/node/api/slint-ui/namespaces/platform/enumerations/windoweventdispatchresult/)

***

### hide()

> **hide**(): `void`

Defined in: [api/node/typescript/index.ts:125](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L125)

Hides the window, so that it is not visible anymore.

#### Returns

`void`

***

### onCloseRequested()

> **onCloseRequested**(`callback`): `void`

Defined in: [api/node/typescript/index.ts:143](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L143)

Sets the callback that's invoked when the user tries to close the window.
The callback returns whether to hide the window or to keep it open.

```js
app.window.onCloseRequested(() => {
    if (hasUnsavedChanges()) {
        return slint.CloseRequestResponse.KeepWindowShown;
    }
    return slint.CloseRequestResponse.HideWindow;
});
```

#### Parameters

##### callback

() => [`CloseRequestResponse`](/latest/docs/node/api/enumerations/closerequestresponse/)

#### Returns

`void`

***

### requestRedraw()

> **requestRedraw**(): `void`

Defined in: [api/node/typescript/index.ts:128](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L128)

Issues a request to the windowing system to re-render the contents of the window.

#### Returns

`void`

***

### show()

> **show**(): `void`

Defined in: [api/node/typescript/index.ts:122](https://github.com/slint-ui/slint/blob/master/api/node/typescript/index.ts#L122)

Shows the window on the screen. An additional strong reference on the
associated component is maintained while the window is visible.

#### Returns

`void`