Safe Haskell | None |
---|---|
Language | Haskell98 |
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.
- data ProgressBar
- newProgressBar :: Attr -> Attr -> IO (Widget ProgressBar)
- setProgress :: Widget ProgressBar -> Int -> IO ()
- setProgressTextAlignment :: Widget ProgressBar -> Alignment -> IO ()
- setProgressText :: Widget ProgressBar -> Text -> IO ()
- addProgress :: Widget ProgressBar -> Int -> IO ()
- getProgress :: Widget ProgressBar -> IO Int
- onProgressChange :: Widget ProgressBar -> (Int -> IO ()) -> IO ()
Documentation
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 Int Source
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.