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

Safe HaskellNone

Graphics.Vty.Widgets.Table

Description

This module provides a table layout widget capable of laying out columns of widgets with various padding and alignment properties. For complete details, please see the Vty-ui User's Manual.

Synopsis

Documentation

data TableCell Source

The wrapper type for all table cells; stores the widgets themselves in addition to alignment and padding settings. Alignment and padding settings on a cell override the column- and table-wide defaults.

data ColumnSize Source

The type of column size policies.

Constructors

ColFixed Int

The column has the specified fixed width in columns.

ColAuto

The column's width is a function of space available to the table at rendering time.

data BorderStyle Source

The border configuration of a table.

Constructors

BorderPartial [BorderFlag] 
BorderFull

A partial set of border flags.

BorderNone

Don't draw any borders anywhere.

data BorderFlag Source

The types of borders we can have in a table.

Constructors

Rows

Borders between rows.

Columns

Borders between columns.

Edges

Borders around the outside edges of the table.

class RowLike a whereSource

The class of types whose values can be used to construct table rows.

Methods

mkRow :: a -> TableRowSource

Instances

RowLike TableRow 
RowLike TableCell 
RowLike a => RowLike [a] 
Show a => RowLike (Widget a) 

data TableError Source

Constructors

ColumnCountMismatch

A row added to the table did not have the same number of widgets as the table has columns.

CellImageTooBig

The image rendered by a cell widget exceeded the size permitted by the cell.

BadTableWidgetSizePolicy Int

A table cell contains a widget which grows vertically, which is not permitted.

data ColumnSpec Source

The specification of a column's settings. The alignment and padding of a column specification override the table-wide default.

(.|.) :: (RowLike a, RowLike b) => a -> b -> TableRowSource

Row constructor using RowLike instances.

newTable :: [ColumnSpec] -> BorderStyle -> IO (Widget Table)Source

Create a table widget using a list of column specifications and a border style.

setDefaultCellAlignment :: Widget Table -> Alignment -> IO ()Source

Set the default table-wide cell alignment.

setDefaultCellPadding :: Widget Table -> Padding -> IO ()Source

Set the default table-wide cell padding.

addRow :: RowLike a => Widget Table -> a -> IO ()Source

Add a row to the table. Use RowLike instances to populate the row. Throws BadTableWidgetSizePolicy if any widgets in the row grow vertically; throws ColumnCountMismatch if the row's number of columns does not match the table's column count.

addHeadingRow :: Widget Table -> Attr -> [Text] -> IO [Widget FormattedText]Source

Add a heading row to a table. Adds a row using the specified |labels and attribute. Returns the widgets it constructed as a |side-effect in case you want to do something with them.

addHeadingRow_ :: Widget Table -> Attr -> [Text] -> IO ()Source

Add a heading row to a table. Adds a row using the specified |labels and attribute.

column :: ColumnSize -> ColumnSpecSource

Create a column.

customCell :: Show a => Widget a -> TableCellSource

Create a custom TableCell to set its alignment and/or padding settings.

emptyCell :: TableCellSource

Create an empty table cell.