gal/struct_screen.go

24 lines
398 B
Go

package main
import "github.com/jroimartin/gocui"
type screen interface {
setViewDefaults(*gocui.View)
setViewTextAndCursor(*gocui.View, string)
getViewValue(*gocui.Gui)
}
type position struct {
// value = pct * MAX + abs
pct float32
abs int
}
func (p position) getCoordinate(max int) int {
return int(p.pct*float32(max)) + p.abs
}
type viewPosition struct {
x0, y0, x1, y1 position
}