diff options
| author | Pietro Gagliardi <[email protected]> | 2014-06-30 22:48:12 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-06-30 22:48:12 -0400 |
| commit | ffa1bbe0b91a8c812ddcea5c5d65e55f60d07f33 (patch) | |
| tree | 000fadd9af11843d92e7f0eee49fa90cca1379cd /progressbar.go | |
| parent | 990d50e9a153681a091a23734f8962e728fde1b0 (diff) | |
Restored the previous new API. I'm going to change it so that events are callbacks rather than using a window handler, but other than that... yeah.
Diffstat (limited to 'progressbar.go')
| -rw-r--r-- | progressbar.go | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/progressbar.go b/progressbar.go index e7c7149..875a262 100644 --- a/progressbar.go +++ b/progressbar.go @@ -2,16 +2,11 @@ package ui -import ( - "sync" -) - // A ProgressBar is a horizontal rectangle that fills up from left to right to indicate the progress of a long-running task. // This progress is represented by an integer within the range [0,100], representing a percentage. // Alternatively, a progressbar can show an animation indicating that progress is being made but how much is indeterminate. // Newly-created ProgressBars default to showing 0% progress. type ProgressBar struct { - lock sync.Mutex created bool sysData *sysData initProg int @@ -30,9 +25,6 @@ func NewProgressBar() *ProgressBar { // Otherwise, SetProgress panics. // Calling SetProgress(-1) repeatedly will neither leave indeterminate mode nor stop any animation involved in indeterminate mode indefinitely; any other side-effect of doing so is implementation-defined. func (p *ProgressBar) SetProgress(percent int) { - p.lock.Lock() - defer p.lock.Unlock() - if percent < -1 || percent > 100 { panic("percent value out of range") } @@ -44,9 +36,6 @@ func (p *ProgressBar) SetProgress(percent int) { } func (p *ProgressBar) make(window *sysData) error { - p.lock.Lock() - defer p.lock.Unlock() - err := p.sysData.make(window) if err != nil { return err |
