Exemplo n.º 1
0
func main() {
	screen.Init()

	e := editor.New()
	e.Draw()
	screen.Refresh()

	go screen.WaitForInput(e.Command)
	e.MainLoop()
	screen.Close()
}
Exemplo n.º 2
0
func (e *T) Draw() {
	e.Gutter.Draw()
	e.EditArea.Draw()
	e.Panel.Draw()
	e.CmdLine.Draw()

	W, H := screen.Size()
	Xa, Xb := e.Gutter.Width, W-e.Panel.Width
	screen.DrawVerticalLine(Xa, 0, H-3)
	screen.DrawVerticalLine(Xb, 0, H-3)
	screen.DrawHorizontalLine(0, W-1, H-2)
	screen.PutCell(Xa, H-2, '┴')
	screen.PutCell(Xb, H-2, '┴')

	// paint viewports
	//s.Gutter.Paint(termbox.ColorGreen)
	//s.EditArea.Paint(termbox.ColorBlue)
	//s.Panel.Paint(termbox.ColorRed)
	//s.CmdLine.Paint(termbox.ColorYellow)

	screen.Refresh()
}