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

Graphics.Vty.Widgets.Edit

Description

This module provides a one-line editing interface.

Synopsis

Documentation

data Edit Source

Instances

editWidget :: MonadIO m => m (Widget Edit)Source

Create a new editing widget.

getEditText :: MonadIO m => Widget Edit -> m StringSource

Get the current contents of the edit widget.

setEditText :: MonadIO m => Widget Edit -> String -> m ()Source

Set the contents of the edit widget.

setEditCursorPosition :: MonadIO m => Widget Edit -> Int -> m ()Source

Set the current edit widget cursor position. Invalid cursor positions will be ignored.

getEditCursorPosition :: MonadIO m => Widget Edit -> m IntSource

Get the edit widget's current cursor position.

setEditMaxLength :: MonadIO m => Widget Edit -> Int -> m ()Source

Set the maximum length of the edit widget's content.

onActivate :: MonadIO m => Widget Edit -> (Widget Edit -> IO ()) -> m ()Source

Register handlers to be invoked when the edit widget has been ''activated'' (when the user presses Enter while the widget is focused).

onChange :: MonadIO m => Widget Edit -> (String -> IO ()) -> m ()Source

Register handlers to be invoked when the edit widget's contents change. Handlers will be passed the new contents.

onCursorMove :: MonadIO m => Widget Edit -> (Int -> IO ()) -> m ()Source

Register handlers to be invoked when the edit widget's cursor position changes. Handlers will be passed the new cursor position, relative to the beginning of the string (position 0).