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

Graphics.Vty.Widgets.Core

Contents

Description

This module is the core of this library; it provides infrastructure for creating new types of widgets and extending their functionality. This module provides various bits of infrastructure, including:

  • modeling user interface widgets
  • managing changes in focus between widgets
  • managing widget state

This module does not provide any concrete widget types. For in-depth discussion on this module's API and widget implementation in particular, see the Vty-ui User's Manual.

Synopsis

Widget Infrastructure

updateWidgetState :: MonadIO m => Widget a -> (a -> a) -> m ()Source

getState :: MonadIO m => Widget a -> m aSource

(<~) :: MonadIO m => (a -> b) -> IORef a -> m bSource

(<~~) :: MonadIO m => (a -> b) -> Widget a -> m bSource

Rendering

Miscellaneous

class HasFocusAttr w whereSource

Methods

setFocusAttribute :: MonadIO m => w -> Attr -> m ()Source

Events

onKeyPressed :: MonadIO m => Widget a -> (Widget a -> Key -> [Modifier] -> IO Bool) -> m ()Source

onGainFocus :: MonadIO m => Widget a -> (Widget a -> IO ()) -> m ()Source

onLoseFocus :: MonadIO m => Widget a -> (Widget a -> IO ()) -> m ()Source

Focus management

addToFocusGroup :: (MonadIO m, Show a) => Widget FocusGroup -> Widget a -> m (Widget FocusEntry)Source

focus :: MonadIO m => Widget a -> m ()Source