io7m | single-page | multi-page | JSycamore User Manual
2.4. Windows
Previous
2.4. Windows
Up
2.4.2. Window Decorations
Next

# 2.4.1. Description

- 2.4.1.1. Overview
- 2.4.1.2. Window Order
- 2.4.1.3. Window Visibility
- 2.4.1.4. Window Layers
- 2.4.1.5. Snapping

## 2.4.1.1. Overview

### 2.4.1.1.1. Windows

2
A window is an interactive, resizable, rectangular region that acts as a container for components.

## 2.4.1.2. Window Order

1
Each window is assigned an abstract order value by the screen in which it resides. The order encodes the notion of windows being in a stack, with the window at the top of the stack being the frontmost or focused window. When the user clicks on any component within a window, that window is moved to the top of the stack and becomes focused.

## 2.4.1.3. Window Visibility

1
Windows are either visible, or invisible. An invisible window is not rendered, and does not receive events.
2
When a window's visibility changes, events of type SyWindowBecameInvisible or SyWindowBecameVisible will be published.

## 2.4.1.4. Window Layers

1
Windows can be grouped into layers. A layer is an integer value N such that all windows with a layer value less than N are considered to be below windows with layer value N. All windows with a layer value greater than N are considered to be above windows with layer value N.
2
Within an individual layer, window order decides which windows are above or below other windows in that layer.
3
Window layers are a somewhat advanced feature, and most applications will not need to use them directly. They are primarily useful for implementing UI elements that must temporarily appear above all other elements, such as notifications or menus. They are also useful for implementing user interfaces for games and other simulations; the game's HUD can be placed on one layer, and a "pause" screen UI can be placed on a separate layer above the HUD layer, and the layers can individually be shown or hidden as is appropriate.

## 2.4.1.5. Snapping

1
The positions and sizes of windows can be configured to snap to given values. For example, if a window's positionSnapping attribute is set to 16, whenever the position of a window is set (either manually, or via the user dragging the window), the position on both axes will snap to the nearest multiple of 16.
2.4. Windows
Previous
2.4. Windows
Up
2.4.2. Window Decorations
Next
io7m | single-page | multi-page | JSycamore User Manual