From 77a0f68758905faa74407499ff92c90929e27989 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Wed, 10 Jan 2018 22:41:15 -0500 Subject: Make termbox event loop async --- ui/account.go | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ui/account.go (limited to 'ui/account.go') diff --git a/ui/account.go b/ui/account.go new file mode 100644 index 00000000..0949e524 --- /dev/null +++ b/ui/account.go @@ -0,0 +1,41 @@ +package ui + +import ( + tb "github.com/nsf/termbox-go" + + "git.sr.ht/~sircmpwn/aerc2/config" + "git.sr.ht/~sircmpwn/aerc2/worker" +) + +type AccountTab struct { + Config *config.AccountConfig + Worker *worker.Worker + Parent *UIState +} + +func NewAccountTab(conf *config.AccountConfig, work *worker.Worker) *AccountTab { + return &AccountTab{ + Config: conf, + Worker: work, + } +} + +func (acc *AccountTab) Name() string { + return acc.Config.Name +} + +func (acc *AccountTab) Invalid() bool { + return false +} + +func (acc *AccountTab) SetParent(parent *UIState) { + acc.Parent = parent +} + +func (acc *AccountTab) Render(at Geometry) { + cell := tb.Cell{ + Fg: tb.ColorDefault, + Bg: tb.ColorDefault, + } + TPrintf(&at, cell, "%s", acc.Name()) +} -- cgit