container (cellium v0.1.0)

View Source

Container widgets are used to arrange other widgets in a specific layout. They support both horizontal and vertical orientations and handle the distribution of space among their children.

Summary

Functions

Creates a new container widget.

Renders the container and its debug visualization if enabled.

Renders the container when it or one of its children has focus.

Functions

new(Id, Orientation)

-spec new(term(), horizontal | vertical) -> map().

Creates a new container widget.

Parameters:

  • Id: A unique identifier for the container.
  • Orientation: The layout direction, either horizontal or vertical.

render(Container, Buffer)

-spec render(map(), map()) -> map().

Renders the container and its debug visualization if enabled.

Normally renders nothing visible. When debug mode is enabled, draws an underscore pattern filling the container's bounds to visualize its layout area.

render_focused(Container, Buffer)

-spec render_focused(map(), map()) -> map().

Renders the container when it or one of its children has focus.