-
Notifications
You must be signed in to change notification settings - Fork 146
Container API
The container package is used to establish and mutate the layout of the terminal. An instance of the container object is required to start the Termdash application, see the Termdash API for details.
The container splits the raw terminal into smaller portions (sub-containers). The developer decides how the splits are organized. Design of the container object is heavily inspired by the i3 window manager, specifically by how the i3 wm organizes the layout of application windows on the screen.
Developers can also use the container to customize the look of the Termdash application.
Apart from organising the terminal layout, the Termdash infrastructure uses the container to call the Draw method on all placed widgets and map virtual canvases given to widgets into the raw terminal. The container is also responsible for distributing events to individual widgets.
Layout of the terminal is organized in a binary tree structure. Each container is a node in this tree. Unless the node was created empty, it contains one of the following:
- two sub-containers; OR
- a widget.
Given a container, developers can create sub-containers by splitting the container. There are two kinds of splits:
- horizontal split, which creates top and bottom sub-containers.
- vertical split, which creates left and right sub-containers.
This property is recursive, meaning developers can further split the sub-containers using the same rules.
See a typo, something missing or outright wrong? Feel free to edit the Wiki pages directly, alternatively talk to us.

