examples update
Vladimir Bauer
6 years ago
| 36 | 36 |
name := "Single Bar:"
|
| 37 | 37 |
// adding a single bar, which will inherit container's width
|
| 38 | 38 |
bar := p.AddBar(int64(total),
|
| 39 | |
// set custom bar style, default one is "[=>-]"
|
|
39 |
// override mpb.DefaultBarStyle, which is "[=>-]<+"
|
| 40 | 40 |
mpb.BarStyle("╢▌▌░╟"),
|
| 41 | 41 |
mpb.PrependDecorators(
|
| 42 | 42 |
// display our name with one space on the right
|
| 21 | 21 |
bar := p.AddBar(int64(total),
|
| 22 | 22 |
// reverse Bar#1
|
| 23 | 23 |
mpb.BarOptOnCond(mpb.BarReverse(), func() bool { return i == 1 }),
|
| 24 | |
mpb.BarNoBrackets(),
|
| 25 | 24 |
mpb.PrependDecorators(
|
| 26 | 25 |
// simple name decorator
|
| 27 | 26 |
decor.Name(name),
|
| 15 | 15 |
name := "Single Bar:"
|
| 16 | 16 |
// adding a single bar, which will inherit container's width
|
| 17 | 17 |
bar := p.AddBar(int64(total),
|
| 18 | |
// set custom bar style, default one is "[=>-]"
|
|
18 |
// override mpb.DefaultBarStyle, which is "[=>-]<+"
|
| 19 | 19 |
mpb.BarStyle("╢▌▌░╟"),
|
| 20 | 20 |
mpb.PrependDecorators(
|
| 21 | 21 |
// display our name with one space on the right
|
| 53 | 53 |
type refiller interface {
|
| 54 | 54 |
SetRefill(int64)
|
| 55 | 55 |
}
|
| 56 | |
filler := mpb.NewBarFiller()
|
|
56 |
filler := mpb.NewBarFiller(mpb.DefaultBarStyle, false)
|
| 57 | 57 |
nextCh := make(chan struct{}, 1)
|
| 58 | 58 |
var msg *string
|
| 59 | 59 |
return func(w io.Writer, width int, st *decor.Statistics) {
|