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

Safe HaskellNone

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 <https:github.comHeinrichApfelmusthreepenny-guiblobmasterdocdesign-widgets.md widget design guide>.

Tidings

data Tidings a Source

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

Instances

Functor Tidings 
Applicative Tidings

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

tidings :: Behavior a -> Event a -> Tidings aSource

Smart constructor. Combine facts and rumors into Tidings.

Widgets

Input widgets

data TextEntry Source

A single-line text entry.

Instances

entrySource

Arguments

:: Behavior String

Display value when the element does not have focus.

-> UI TextEntry 

Create a single-line text entry.

userText :: TextEntry -> Tidings StringSource

User changes to the text value.

ListBox

data ListBox a Source

A list of values. The user can select entries.

Instances

listBoxSource

Arguments

:: forall a . 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).