Push commands to the status stack

This commit is contained in:
Drew DeVault 2018-02-27 21:29:50 -05:00
parent cab3771e17
commit 30c85dd4ab

View file

@ -1,6 +1,7 @@
package widgets package widgets
import ( import (
"fmt"
"log" "log"
"time" "time"
@ -45,14 +46,12 @@ func NewAerc(logger *log.Logger) *Aerc {
grid.AddChild(statusbar).At(2, 1) grid.AddChild(statusbar).At(2, 1)
statusline := NewStatusLine() statusline := NewStatusLine()
statusline.Push("test status!", 6 * time.Second)
statusline.Push("test error!", 3 * time.Second).
Color(tb.ColorRed, tb.ColorBlack)
statusbar.Push(statusline) statusbar.Push(statusline)
exline := NewExLine(func(command string) { exline := NewExLine(func(command string) {
statusline.Push(fmt.Sprintf("TODO: execute %s", command),
3 * time.Second)
statusbar.Pop() statusbar.Pop()
logger.Printf("TODO: execute command: %s\n", command)
}, func() { }, func() {
statusbar.Pop() statusbar.Pop()
}) })