Safe Haskell | None |
---|
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.
- data Table
- data TableCell
- data ColumnSize
- data BorderStyle
- = BorderPartial [BorderFlag]
- | BorderFull
- | BorderNone
- data BorderFlag
- class RowLike a where
- mkRow :: a -> TableRow
- data TableError
- data ColumnSpec = ColumnSpec {}
- (.|.) :: (RowLike a, RowLike b) => a -> b -> TableRow
- newTable :: [ColumnSpec] -> BorderStyle -> IO (Widget Table)
- setDefaultCellAlignment :: Widget Table -> Alignment -> IO ()
- setDefaultCellPadding :: Widget Table -> Padding -> IO ()
- addRow :: RowLike a => Widget Table -> a -> IO ()
- addHeadingRow :: Widget Table -> Attr -> [Text] -> IO [Widget FormattedText]
- addHeadingRow_ :: Widget Table -> Attr -> [Text] -> IO ()
- column :: ColumnSize -> ColumnSpec
- customCell :: Show a => Widget a -> TableCell
- emptyCell :: TableCell
Documentation
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.
data BorderStyle Source
The border configuration of a table.
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.
The class of types whose values can be used to construct table rows.
data TableError Source
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.
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.