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

Safe HaskellNone



This module provides a ''progress bar'' widget which stores a progress value between 0 and 100 inclusive and supports a text label. Use the schedule function to modify the progress bar's state from a thread.



newProgressBar :: Attr -> Attr -> IO (Widget ProgressBar)Source

Create a new progress bar with the specified completed and uncompleted attributes, respectively. The foreground of the attributes will be used to show the progress bar's label, if any.

setProgress :: Widget ProgressBar -> Int -> IO ()Source

Set the progress bar's progress value. Values outside the allowed range will be ignored.

setProgressTextAlignment :: Widget ProgressBar -> Alignment -> IO ()Source

Set the progress bar's text label alignment.

setProgressText :: Widget ProgressBar -> Text -> IO ()Source

Set the progress bar's text label.

addProgress :: Widget ProgressBar -> Int -> IO ()Source

Add a delta value to the progress bar's current value.

getProgress :: Widget ProgressBar -> IO IntSource

Get the progress bar's current progress value.

onProgressChange :: Widget ProgressBar -> (Int -> IO ()) -> IO ()Source

Register a handler to be invoked when the progress bar's progress value changes. The handler will be passed the new progress value.