vty-ui-1.0: An interactive terminal user interface library for Vty

Graphics.Vty.Widgets.Box

Contents

Description

This module provides vertical and horizontal box layout widgets using the Box type. Box widgets use their child widgets' size policies and their space allocation settings to determine layout.

Box widgets propagate key and focus events to their children.

For more details, see the Vty-ui User's Manual.

Synopsis

Documentation

data Box a b Source

Instances

Show (Box a b) 

data ChildSizePolicy Source

Child size policy applied to a box.

Constructors

PerChild IndividualPolicy IndividualPolicy

A per-child policy.

Percentage Int

Percentage, p, of space given to first child, which implies that (100 - p) percent given to the second.

data IndividualPolicy Source

Individual child widget policy applied to a child widget contained in a box.

Constructors

BoxAuto

The child's growth policy will be used to determine layout. The child widget layout will also be affected by the policy of the other widget in the box.

BoxFixed Int

A fixed number of rows or columns, depending on box type, will be allocated to the child.

data BoxError Source

Constructors

BadPercentage

Indicates that a given percentage value was invalid.

Box Constructors

hBox :: (MonadIO m, Show a, Show b) => Widget a -> Widget b -> m (Widget (Box a b))Source

Create a horizontal box widget containing two widgets side by side. Space consumed by the box will depend on its contents, available space, and the box child size policy.

vBox :: (MonadIO m, Show a, Show b) => Widget a -> Widget b -> m (Widget (Box a b))Source

Create a vertical box widget containing two widgets, one above the other. Space consumed by the box will depend on its contents, available space, and the box child size policy.

(<++>) :: (MonadIO m, Show a, Show b) => m (Widget a) -> m (Widget b) -> m (Widget (Box a b))Source

Create a horizontal box widget using monadic widget constructors.

(<-->) :: (MonadIO m, Show a, Show b) => m (Widget a) -> m (Widget b) -> m (Widget (Box a b))Source

Create a vertical box widget using monadic widget constructors.

Box Configuration

setBoxSpacing :: MonadIO m => Widget (Box a b) -> Int -> m ()Source

Set the spacing in between a box's child widgets in rows or columns, depending on the box type.

withBoxSpacing :: MonadIO m => Int -> Widget (Box a b) -> m (Widget (Box a b))Source

defaultChildSizePolicy :: ChildSizePolicySource

The default box child size policy, which defers to the children to determine layout.

setBoxChildSizePolicy :: MonadIO m => Widget (Box a b) -> ChildSizePolicy -> m ()Source

Set the box child size policy. Throws BadPercentage if the size |policy uses an invalid percentage value, which must be between 0 |and 100 inclusive.

Child Widget References