use GridBufferer as rows in CompactGrid

This commit is contained in:
Bradley Cicenas
2017-03-06 00:46:00 +00:00
parent 3bb48e91ae
commit 1dd5e53b37
3 changed files with 36 additions and 29 deletions

View File

@@ -13,15 +13,19 @@ type CompactHeader struct {
func NewCompactHeader() *CompactHeader {
fields := []string{"", "NAME", "CID", "CPU", "MEM", "NET RX/TX"}
header := &CompactHeader{}
header := &CompactHeader{Height: 2}
for _, f := range fields {
header.pars = append(header.pars, headerPar(f))
}
return header
}
func (c *CompactHeader) GetHeight() int {
return c.Height
}
func (c *CompactHeader) SetWidth(w int) {
x := 1
x := c.X
autoWidth := calcWidth(w, 5)
for n, col := range c.pars {
// set status column to static width
@@ -38,6 +42,10 @@ func (c *CompactHeader) SetWidth(w int) {
c.Width = w
}
func (c *CompactHeader) SetX(x int) {
c.X = x
}
func (c *CompactHeader) SetY(y int) {
for _, p := range c.pars {
p.SetY(y)