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



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.



newProgressBar :: Color -> Color -> IO 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 :: ProgressBar -> Int -> IO ()Source

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

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

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

getProgress :: ProgressBar -> IO IntSource

Get the progress bar's current progress value.

onProgressChange :: 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.