예제 #1
0
파일: render.go 프로젝트: sdolan99/inspect
// Init initializes termui library. This function should be called before any others.
// After initialization, the library must be finalized by 'Close' function.
func Init() error {
	Body = NewGrid()
	Body.X = 0
	Body.Y = 0
	Body.BgColor = theme.BodyBg
	defer func() {
		w, _ := tm.Size()
		Body.Width = w
		evtListen()
	}()
	return tm.Init()
}
예제 #2
0
파일: render.go 프로젝트: sdolan99/inspect
// TermHeight returns the current terminal's height.
func TermHeight() int {
	tm.Sync()
	_, h := tm.Size()
	return h
}
예제 #3
0
파일: render.go 프로젝트: sdolan99/inspect
// TermWidth returns the current terminal's width.
func TermWidth() int {
	tm.Sync()
	w, _ := tm.Size()
	return w
}