This module provides a one-line editing interface.
- data Edit
- editWidget :: MonadIO m => m (Widget Edit)
- getEditText :: MonadIO m => Widget Edit -> m String
- setEditText :: MonadIO m => Widget Edit -> String -> m ()
- setEditCursorPosition :: MonadIO m => Widget Edit -> Int -> m ()
- getEditCursorPosition :: MonadIO m => Widget Edit -> m Int
- setEditMaxLength :: MonadIO m => Widget Edit -> Int -> m ()
- onActivate :: MonadIO m => Widget Edit -> (Widget Edit -> IO ()) -> m ()
- onChange :: MonadIO m => Widget Edit -> (String -> IO ()) -> m ()
- onCursorMove :: MonadIO m => Widget Edit -> (Int -> IO ()) -> m ()
Documentation
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.
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).