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

Safe HaskellNone
LanguageHaskell98

Graphics.Vty.Widgets.Button

Description

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.

Synopsis

Documentation

newButton :: Text -> IO Button Source

Create a button. Get its underlying widget with buttonWidget.

buttonWidget :: Button -> Widget Padded Source

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.