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

Safe HaskellNone



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 :: Text -> IO 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 :: Button -> (Button -> IO ()) -> IO ()Source

Register a handler for the button press event.

pressButton :: Button -> IO ()Source

Programmatically press a button to trigger its event handlers.

setButtonText :: Button -> Text -> IO ()Source

Set the text label on a button.