-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
22 lines (20 loc) · 803 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// Demo code for the Frame primitive.
package main
import (
"git.parallelcoin.io/dev/9/pkg/util/tcell"
"git.parallelcoin.io/dev/tview"
)
func main() {
app := tview.NewApplication()
frame := tview.NewFrame(tview.NewBox().SetBackgroundColor(tcell.ColorBlue)).
SetBorders(2, 2, 2, 2, 4, 4).
AddText("Header left", true, tview.AlignLeft, tcell.ColorWhite).
AddText("Header middle", true, tview.AlignCenter, tcell.ColorWhite).
AddText("Header right", true, tview.AlignRight, tcell.ColorWhite).
AddText("Header second middle", true, tview.AlignCenter, tcell.ColorRed).
AddText("Footer middle", false, tview.AlignCenter, tcell.ColorGreen).
AddText("Footer second middle", false, tview.AlignCenter, tcell.ColorGreen)
if err := app.SetRoot(frame, true).Run(); err != nil {
panic(err)
}
}