src/swipl-devel/packages/xpce/man/refmanual/md/tile.md

class tile {#class-tile}

A tile is an object that manages the area of a rectangular object, such as a graphical or window. Tiles are used by class frame to manage the layout of the windows in the frame.

Normal users hardly ever need to be aware of the existence of tile objects. Tiles are managed by and manages window objects and frame objects. The only relevant messages that are directly delegated to from class window are ->hor_stretch, ->hor_shrink, ->ver_stretch and ->ver_shrink that determine how easily the managed window object can grow bigger or smaller.

Tiles are organised in a consists-of hierarchy. The leafs of this tree are connected to the actually managed objects (for frames, these are the windows). The root of the tree is associated with the total area over which the objects must be distributed (the frame).

A tile describes the ideal size as well as the merits to be larger (stretch) or get smaller (shrink). A tile negotiates with its super-tile in the consists-of hierarchy to get a size that is a close as possible to its ideal size, but it is always the super-tile that decides on the size.

Leaf-tiles communicate with the actual object by means of the methods

| <-width, <-height | To set the initial ideal size |
| ->set: X, Y, W, H | To resize/move the object     |

The non-leaf tiles are either horizontal or vertical. Horizontal tiles manage a set of sub-tiles that are next to one-another. Vertical tiles manage a set of sub-tiles that are above one-another.

Defining a tile hierarchy {#class-tile-defining-a-tile-hierarchy}

A tile-hierarchy is build inwards-out. First of all, all objects that need to be tiled are given a tile (the leaf-tiles). Next, the deepest-nested adjacent tiles that must have the same width or height are connected to one another, etc. This is done using the ->left, ->above, etc. behaviour. The creation messages are always sent to the leaf-tiles, who create and maintain tiles higher in the hierarchy whenever needed.

@see frame<-tile @see topic Window Layout @see class window @see class frame

Instance variables {#class-tile-instvars}

Send methods {#class-tile-send}

Get methods {#class-tile-get}



Try the rswipl package in your browser

Any scripts or data that you put into this service are public.

rswipl documentation built on June 16, 2026, 5:07 p.m.