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.
- data ProgressBar
- newProgressBar :: MonadIO m => Color -> Color -> m ProgressBar
- progressBarWidget :: ProgressBar -> Widget (Box HFill HFill)
- setProgress :: MonadIO m => ProgressBar -> Int -> m ()
- addProgress :: MonadIO m => ProgressBar -> Int -> m ()
- getProgress :: MonadIO m => ProgressBar -> m Int
- onProgressChange :: MonadIO m => ProgressBar -> (Int -> IO ()) -> m ()
Documentation
data ProgressBar Source
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.