MCPcopy Create free account
hub / github.com/egonelbre/exp / Paint

Method Paint

progress/main.go:105–128  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

103}
104
105func (processes *Processes) Paint() {
106 termbox.Clear(termbox.ColorDefault, termbox.ColorDefault)
107
108 processes.mu.Lock()
109 defer processes.mu.Unlock()
110
111 x, y := 0, 0
112 for _, process := range processes.list {
113 progress, done := process.Progress()
114 line := fmt.Sprintf("%-10s %4d", process.Name, progress)
115 if done {
116 line += " done"
117 }
118
119 x = 0
120 for _, r := range line {
121 termbox.SetCell(x, y, r, termbox.ColorDefault, termbox.ColorDefault)
122 x++
123 }
124 y++
125 }
126
127 termbox.Flush()
128}
129
130var Processing Processes
131

Callers 1

mainFunction · 0.80

Calls 5

ProgressMethod · 0.80
FlushMethod · 0.80
LockMethod · 0.65
UnlockMethod · 0.65
ClearMethod · 0.45

Tested by

no test coverage detected