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

Graphics.Vty.Widgets.ProgressBar

Description

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

Synopsis

Documentation

newProgressBar :: MonadIO m => Color -> Color -> m ProgressBarSource

Create a new progress bar with the specified completed and uncompleted colors, respectively.

progressBarWidget :: ProgressBar -> Widget (Box HFill HFill)Source

Get the widget of a progress bar.

setProgress :: MonadIO m => ProgressBar -> Int -> m ()Source

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

addProgress :: MonadIO m => ProgressBar -> Int -> m ()Source

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

getProgress :: MonadIO m => ProgressBar -> m IntSource

Get the progress bar's current progress value.

onProgressChange :: MonadIO m => ProgressBar -> (Int -> IO ()) -> m ()Source

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