vty-ui-1.6: An interactive terminal user interface library for Vty

Safe HaskellNone

Graphics.Vty.Widgets.Group

Description

Widget groups. Useful for when you need to swap out many instances of the same widget type in a specific location in an interface. A group has a currently active widget which can be changed with setCurrentGroupEntry. Add a widget to a group with addToGroup; addToGroup returns an action which can be used to set the specified widget as the group's active widget.

Synopsis

Documentation

data Group a Source

A group of widgets of a specified type.

Instances

Show (Group a) 

newGroup :: Show a => IO (Widget (Group a))Source

Create a new empty widget group.

addToGroup :: Widget (Group a) -> Widget a -> IO (IO ())Source

Add a widget to a group. Returns an action which, when evaluated, will update the group state so that its currently-active widget is the one passed to this function.

setCurrentGroupEntry :: Widget (Group a) -> Int -> IO ()Source

Set a group's current entry to the specified index. Use with care.