2013-12-27 21:36:26 +01:00
|
|
|
package gocui
|
|
|
|
|
|
|
|
import (
|
2013-12-31 21:23:28 +01:00
|
|
|
"github.com/nsf/termbox-go"
|
2013-12-27 21:36:26 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
type View struct {
|
2013-12-29 21:29:29 +01:00
|
|
|
Name string
|
|
|
|
X0, Y0, X1, Y1 int
|
2014-01-06 02:21:22 +01:00
|
|
|
CX, CY int
|
2013-12-27 21:36:26 +01:00
|
|
|
BgColor, FgColor termbox.Attribute
|
|
|
|
SelBgColor, SelFgColor termbox.Attribute
|
|
|
|
}
|
|
|
|
|
2014-01-04 02:50:49 +01:00
|
|
|
func NewView(name string, x0, y0, x1, y1 int) (v *View) {
|
2013-12-28 18:49:01 +01:00
|
|
|
v = &View{
|
2013-12-29 21:29:29 +01:00
|
|
|
Name: name,
|
2014-01-04 02:50:49 +01:00
|
|
|
X0: x0,
|
|
|
|
Y0: y0,
|
|
|
|
X1: x1,
|
|
|
|
Y1: y1,
|
2013-12-28 18:49:01 +01:00
|
|
|
BgColor: termbox.ColorBlack,
|
|
|
|
FgColor: termbox.ColorWhite,
|
|
|
|
SelBgColor: termbox.ColorBlack,
|
|
|
|
SelFgColor: termbox.ColorWhite,
|
|
|
|
}
|
|
|
|
return v
|
2013-12-27 21:36:26 +01:00
|
|
|
}
|