Added Info for ProgressBar

This commit is contained in:
aditya-K2 2022-08-29 18:04:34 +05:30
parent d7044c48b1
commit a8959a10e5
1 changed files with 8 additions and 1 deletions

View File

@ -26,12 +26,19 @@ func ConnectRenderer(r interface{ Send(string) }) {
RENDERER = r
}
// ProgressBar is a two-lined Box. First line is the BarTitle
// Second being the actual progress done.
// Use SetProgressFunc to provide the callback which provides the Fields each time the ProgressBar will be Drawn.
// The progressFunc must return (BarTitle, BarTopTitle, BarText, percentage) respectively
type ProgressBar struct {
*tview.Box
BarTitle string
BarText string
BarTopTitle string
progressFunc func() (string, string, string, float64)
progressFunc func() (BarTitle string,
BarTopTitle string,
BarText string,
percentage float64)
}
func (self *ProgressBar) SetProgressFunc(pfunc func() (string, string, string, float64)) *ProgressBar {