brick-0.3: A declarative terminal user interface library

Safe HaskellNone
LanguageHaskell2010

Brick.Focus

Description

This module provides a type and functions for handling focus rings of widgets. Note that this interface is merely provided for managing the focus state for a sequence of widget names; it does not do anything beyond keep track of that.

This interface is experimental.

Synopsis

Documentation

data FocusRing Source #

A focus ring containing a sequence of widget names to focus and a currently-focused widget name.

focusRing :: [Name] -> FocusRing Source #

Construct a focus ring from the list of names.

focusNext :: FocusRing -> FocusRing Source #

Advance focus to the next widget in the ring.

focusPrev :: FocusRing -> FocusRing Source #

Advance focus to the previous widget in the ring.

focusGetCurrent :: FocusRing -> Maybe Name Source #

Get the currently-focused widget name from the ring. If the ring is emtpy, return Nothing.

focusRingCursor Source #

Arguments

:: (a -> FocusRing)

The function used to get the focus ring out of your application state.

-> a

Your application state.

-> [CursorLocation]

The list of available cursor positions.

-> Maybe CursorLocation

The cursor position, if any, that matches the name currently focused by the FocusRing.

Cursor selection convenience function for use as an appChooseCursor value.