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