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



This module provides a ''button'' widget type which has a button-like appearance and generates ''press'' events. Buttons are pressed when a user presses Enter while the button has focus.



newButton :: MonadIO m => String -> m ButtonSource

Create a button. Get its underlying widget with buttonWidget.

buttonWidget :: Button -> Widget PaddedSource

Get a reference to the button's widget to lay it out.

onButtonPressed :: MonadIO m => Button -> (Button -> IO ()) -> m ()Source

Register a handler for the button press event.

pressButton :: MonadIO m => Button -> m ()Source

Programmatically press a button to trigger its event handlers.

setButtonText :: MonadIO m => Button -> String -> m ()Source

Set the text label on a button.