~ghost08/tcell-term

06c8aaf1175028ddc34666362aba703935577959 — Tim Culverhouse 1 year, 5 months ago 2112d3d
api: add size and Watch functions

Add Size and Watch functions to finish satisfying Widget interface

Signed-off-by: Tim Culverhouse <tim@timculverhouse.com>
1 files changed, 6 insertions(+), 0 deletions(-)

M terminal.go
M terminal.go => terminal.go +6 -0
@@ 21,6 21,8 @@ type Terminal struct {

	screen tcell.Screen
	view     views.View

	views.WidgetWatchers
}

func New(screen tcell.Screen, view views.View, opts ...Option) *Terminal {


@@ 63,6 65,10 @@ func (t *Terminal) SetView(view views.View) {
	t.view = view
}

func (t *Terminal) Size() (int, int) {
	return t.view.Size()
}

func (t *Terminal) HandleEvent(e tcell.Event) bool {
	switch e := e.(type) {
	case *tcell.EventKey: