Module rstk::grid

source ·
Expand description

Grid layout - a geometry manager for arranging widgets.

The grid-layout is used in a “builder” style to layout a single widget:

widget.grid()
  .OPTION(VALUE) // 0 or more
  .layout();
  1. grid is called first, to get the GridLayout instance.
  2. layout must be called last, to perform the layout.
  3. zero or more options are added to the GridLayout, to control the position and layout of the widget.

Example

The following example places a label:

label.grid()                    // starts layout definition
    .row(1)                     // at row 1
    .column(2)                  // at column 2
    .column_span(3)             // spanning three columns (i.e. 2,3,4)
    .padx(5)                    // with 5 pixels horizontal spacing
    .sticky(rstk::Sticky::E)    // "attached" to the right-hand side
    .layout();                  // completes the layout

Structs

  • Refers to the settings for a GridLayout.

Traits

  • Common functions for widgets that can be arranged using GridLayouts