Add ttop example

This commit is contained in:
gizak 2015-10-21 11:11:08 -04:00
parent 9ec1539ccc
commit e62b592964

View File

@ -3,18 +3,20 @@
package main
import (
"fmt"
"bufio"
"os"
"errors"
"fmt"
"io"
"os"
"regexp"
"strings"
"runtime"
"sort"
"strconv"
"strings"
"time"
"errors"
"runtime"
"github.com/marigs/termui"
"github.com/gizak/termui"
"github.com/gizak/termui/extra"
)
const statFilePath = "/proc/stat"
@ -211,7 +213,6 @@ func NewCpuTabElems(width int) *CpuTabElems {
LChart: lc}
}
func (cte *CpuTabElems) AddGauge(key string, Y int, width int) *termui.Gauge {
cte.GMap[key] = termui.NewGauge()
cte.GMap[key].Width = width
@ -287,10 +288,10 @@ func main() {
header.HasBorder = false
header.TextBgColor = termui.ColorBlue
tabCpu := termui.NewTab("CPU")
tabMem := termui.NewTab("MEM")
tabCpu := extra.NewTab("CPU")
tabMem := extra.NewTab("MEM")
tabpane := termui.NewTabpane()
tabpane := extra.NewTabpane()
tabpane.Y = 1
tabpane.Width = 30
tabpane.HasBorder = false
@ -365,4 +366,3 @@ func main() {
}
}
}