Safe Haskell | None |
---|
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.
- data Box a b
- data ChildSizePolicy
- data IndividualPolicy
- data BoxError = BadPercentage
- hBox :: (Show a, Show b) => Widget a -> Widget b -> IO (Widget (Box a b))
- vBox :: (Show a, Show b) => Widget a -> Widget b -> IO (Widget (Box a b))
- (<++>) :: (Show a, Show b) => IO (Widget a) -> IO (Widget b) -> IO (Widget (Box a b))
- (<-->) :: (Show a, Show b) => IO (Widget a) -> IO (Widget b) -> IO (Widget (Box a b))
- setBoxSpacing :: Widget (Box a b) -> Int -> IO ()
- withBoxSpacing :: Int -> Widget (Box a b) -> IO (Widget (Box a b))
- defaultChildSizePolicy :: ChildSizePolicy
- setBoxChildSizePolicy :: Widget (Box a b) -> ChildSizePolicy -> IO ()
- getBoxChildSizePolicy :: Widget (Box a b) -> IO ChildSizePolicy
- getFirstChild :: Widget (Box a b) -> IO (Widget a)
- getSecondChild :: Widget (Box a b) -> IO (Widget b)
Documentation
data ChildSizePolicy Source
Child size policy applied to a box.
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.
BadPercentage | Indicates that a given percentage value was invalid. |
Box Constructors
hBox :: (Show a, Show b) => Widget a -> Widget b -> IO (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 :: (Show a, Show b) => Widget a -> Widget b -> IO (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.
(<++>) :: (Show a, Show b) => IO (Widget a) -> IO (Widget b) -> IO (Widget (Box a b))Source
Create a horizontal box widget using monadic widget constructors.
(<-->) :: (Show a, Show b) => IO (Widget a) -> IO (Widget b) -> IO (Widget (Box a b))Source
Create a vertical box widget using monadic widget constructors.
Box Configuration
setBoxSpacing :: Widget (Box a b) -> Int -> IO ()Source
Set the spacing in between a box's child widgets in rows or columns, depending on the box type.
defaultChildSizePolicy :: ChildSizePolicySource
The default box child size policy, which defers to the children to determine layout.
setBoxChildSizePolicy :: Widget (Box a b) -> ChildSizePolicy -> IO ()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.
getBoxChildSizePolicy :: Widget (Box a b) -> IO ChildSizePolicySource
Get the child size policy for a box.