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