flaw-ui-0.1.0.0

LicenseMIT
Safe HaskellNone
LanguageHaskell2010

Flaw.UI.ListBox

Description

 
Synopsis

Documentation

data ListBox v Source #

ListBox is an extendable element allowing user to work with multiple items. It creates and caches temporary element for every cell, sends input events and renders them as a scrollable list efficiently.

Constructors

ListBox 

Fields

newListBox :: Metrics -> [ListBoxColumnDesc v] -> STM (ListBox v) Source #

addListBoxItem :: ListBox v -> v -> STM (ListBoxItemHandle v) Source #

Add new list item to listbox.

removeListBoxItem :: ListBox v -> ListBoxItemHandle v -> STM () Source #

Remove list item by handle.

changeListBoxItem :: ListBox v -> ListBoxItemHandle v -> v -> STM () Source #

Change list item by handle. List item's handle remains valid.

clearListBox :: ListBox v -> STM () Source #

Remove all items from list box.

reorderListBox :: Ord k => ListBox v -> (v -> k) -> STM () Source #

Reorder list box using new sort function.

getListBoxSelectedValues :: ListBox v -> STM [v] Source #

Get list of selected values from list box.

newListBoxTextColumnDesc Source #

Arguments

:: Ord k 
=> Text

Column title.

-> Metric

Column width.

-> (v -> k)

Key function, returns key to sort by.

-> (v -> Text)

Display text function, returns text to display for item.

-> STM (ListBoxColumnDesc v) 

Description of most normal column: text column title, item is shown as text.