From a8959a10e5b381f5ac956b4be360c9474ddba5ed Mon Sep 17 00:00:00 2001 From: aditya-K2 Date: Mon, 29 Aug 2022 18:04:34 +0530 Subject: [PATCH] Added Info for ProgressBar --- ui/progressBar.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ui/progressBar.go b/ui/progressBar.go index 1905bba..25c132c 100644 --- a/ui/progressBar.go +++ b/ui/progressBar.go @@ -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 {