|
Graphics.Vty.Widgets.List |
|
|
Description |
This module provides a List widget for rendering a list of
single-line strings. A List has the following features:
- A style for the list elements
- A styled cursor indicating which element is selected
- A window size indicating how many elements should be visible to
the user
- An internal pointer to the start of the visible window, which
automatically shifts as the list is scrolled
To create a list, see mkList. To modify the list's state, see
scrollDown and scrollUp. To inspect the list, see, see
getSelected and getVisibleItems.
|
|
Synopsis |
|
|
|
Documentation |
|
|
The list widget type.
| Instances | |
|
|
|
:: Attr | The attribute of normal, non-selected items
| -> Attr | The attribute of the selected item
| -> Int | The scrolling window size, i.e., the number of items
which should be visible to the user at any given time
| -> [String] | The list items
| -> List | | Create a new list. Emtpy lists are not allowed.
|
|
|
|
Scroll a list down one position and return the new scrolled list.
This automatically takes care of managing all list state:
- Moves the cursor down one position, unless the cursor is already
in the last position (in which case this does nothing)
- Moves the scrolling window position if necessary (i.e., if the
cursor moves to an item not currently in view)
|
|
|
Scroll a list up one position and return the new scrolled list.
This automatically takes care of managing all list state:
- Moves the cursor up one position, unless the cursor is already
in the first position (in which case this does nothing)
- Moves the scrolling window position if necessary (i.e., if the
cursor moves to an item not currently in view)
|
|
|
Get the currently selected list item.
|
|
|
Given a List, return the items that are currently visible
according to the state of the list. Returns the visible items and
flags indicating whether each is selected.
|
|
Produced by Haddock version 2.4.2 |