threepenny-gui-0.8.1.0: GUI framework that uses the web browser as a display.

Safe HaskellNone
LanguageHaskell98

Graphics.UI.Threepenny.Widgets

Contents

Synopsis

Synopsis

Widgets are reusable building blocks for a graphical user interface. This module collects useful widgets that are designed to work with functional reactive programming (FRP).

For more details and information on how to write your own widgets, see the widget design guide.

Tidings

data Tidings a Source #

Data type representing a behavior (facts) and suggestions to change it (rumors).

Instances

Functor Tidings Source # 

Methods

fmap :: (a -> b) -> Tidings a -> Tidings b #

(<$) :: a -> Tidings b -> Tidings a #

Applicative Tidings Source #

The applicative instance combines rumors and uses facts when some of the rumors are not available.

Methods

pure :: a -> Tidings a #

(<*>) :: Tidings (a -> b) -> Tidings a -> Tidings b #

(*>) :: Tidings a -> Tidings b -> Tidings b #

(<*) :: Tidings a -> Tidings b -> Tidings a #

tidings :: Behavior a -> Event a -> Tidings a Source #

Smart constructor. Combine facts and rumors into Tidings.

Widgets

Input widgets

data TextEntry Source #

A single-line text entry.

entry Source #

Arguments

:: Behavior String

Display value when the element does not have focus.

-> UI TextEntry 

Create a single-line text entry.

userText :: TextEntry -> Tidings String Source #

User changes to the text value.

ListBox

data ListBox a Source #

A list of values. The user can select entries.

Instances

listBox Source #

Arguments

:: Ord a 
=> Behavior [a]

list of items

-> Behavior (Maybe a)

selected item

-> Behavior (a -> UI Element)

display for an item

-> UI (ListBox a) 

Create a ListBox.

userSelection :: ListBox a -> Tidings (Maybe a) Source #

User changes to the current selection (possibly empty).