gal/struct_screen.go

25 lines
419 B
Go

package main
import "github.com/jroimartin/gocui"
type screen interface {
getGoCuiGui() *gocui.Gui
updateViews(*gocui.Gui)
layoutManger(*gocui.Gui) error
addView(string, int, int, int, int)
}
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
}