Skip to content
Jakub Sobon edited this page Mar 30, 2019 · 22 revisions

Doc Status

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 to map virtual canvases given to widgets onto the raw terminal. The container is also responsible for distributing events to individual widgets.

Developers have two options when it comes to building the terminal layout.

  1. Use the container package directly to create layouts organized as a Binary tree layout.
  2. Use the grid package to create layouts organized into a Grid layout.

The created layout can be further customized by any of the following:

  1. Defining margin or padding, see Margin and padding.
  2. Dynamically changing the layout by updating the individual containers, see Dynamic layout.
Clone this wiki locally