|
Graphics.Vty.Widgets.Base |
|
|
Description |
A collection of primitive user interface widgets for composing and
laying out Graphics.Vty user interfaces. This module provides
basic static and box layout widgets and a type class for rendering
widgets to Vty Images.
Each widget type supplied by this library is exported as a type and
an associated constructor function (e.g., Text and text, Box
and vBox / hBox).
|
|
Synopsis |
|
|
|
Documentation |
|
|
The class of user interface widgets. Note that the growth
properties growHorizontal and growVertical are used to control
rendering order; if a widget can grow to fill available space,
then neighboring fixed-size widgets will be rendered first so
remaining space can be computed. Then, variable-sized (growable)
widgets will be rendered last to consume that space.
| | Methods | | Given a widget, render it with the given dimensions. The
resulting Image should not be larger than the specified
dimensions, but may be smaller.
| | | Will this widget expand to take advantage of available
horizontal space?
| | | Will this widget expand to take advantage of available
vertical space?
| | | The primary attribute of this widget, used when composing
widgets. For example, if you want to compose a widget A with
a space-filling widget B, you probably want B's text
attributes to be identical to those of A.
| | | Apply the specified attribute to this widget.
|
| | Instances | |
|
|
|
Given a Widget and a Vty object, render the widget using the
current size of the terminal controlled by Vty. Returns the
rendered Widget as an Image.
|
|
|
A wrapper for all widget types used in normalizing heterogeneous
lists of widgets. See anyWidget.
| Instances | |
|
|
|
A text widget consisting of a string rendered using an
attribute. See text.
| Instances | |
|
|
|
A box layout widget capable of containing two Widgets
horizontally or vertically. See hBox and vBox. Boxes lay out
their children as follows:
- If both children are expandable in the same dimension (i.e., both
vertically or both horizontally), the children are each given
half of the parent container's available space
- If one of the children is expandable and the other is static, the
static child is rendered first and the remaining space is given
to the expandable child
- Otherwise, both children are rendered in top-to-bottom or
left-to-right order and the resulting container uses only as much
space as its children combined
| Instances | |
|
|
|
A fill widget for filling available vertical or horizontal space
in a box layout. See vFill and hFill.
| Instances | |
|
|
|
An alias for hBox intended as sugar to chain widgets
horizontally.
|
|
|
An alias for vBox intended as sugar to chain widgets vertically.
|
|
|
Wrap a Widget in the AnyWidget type for normalization
purposes.
|
|
|
:: Attr | The attribute to use to render the text
| -> String | The text to display
| -> Text | | Create a Text widget.
|
|
|
|
:: (Widget a, Widget b) | | => a | The left widget
| -> b | The right widget
| -> Box | | Create a horizontal box layout widget containing two widgets side
by side. Space consumed by the box will depend on its contents and
the available space.
|
|
|
|
:: (Widget a, Widget b) | | => a | The top widget
| -> b | The bottom widget
| -> Box | | Create a vertical box layout widget containing two widgets. Space
consumed by the box will depend on its contents and the available
space.
|
|
|
|
:: Attr | The attribute to use to render the fill
| -> Char | The character to fill
| -> Int | The height, in rows, of the filled area; width of the
fill depends on available space
| -> Fill | | Create an horizonal fill widget.
|
|
|
|
:: Attr | The attribute to use to render the fill
| -> Char | The character to fill
| -> Fill | | Create a vertical fill widget. The dimensions of the widget will
depend on available space.
|
|
|
Produced by Haddock version 2.4.2 |