Newer
Older
import (
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/app"
"github.com/rivo/tview"
"google.golang.org/grpc"
)
type MainView struct {
pages *tview.Pages
commandsListView *CommandListView
resultAndInputView *ResultAndInputView
func NewMainView(app *app.App, conn *grpc.ClientConn) *MainView {
resultAndInputView: NewResultAndInputView(app),
mv.commandsListView.GetCommands(app, mv.resultAndInputView, conn)
AddItem(mv.headerView.GetContent(), 0, 0, 1, 2, 0, 0, false).
AddItem(mv.footerView.GetContent(), 2, 0, 1, 2, 0, 0, false)
mv.mainGrid.AddItem(mv.commandsListView.GetContent(), 1, 0, 1, 1, 0, 0, true).
AddItem(mv.resultAndInputView.GetContent(), 1, 1, 1, 1, 0, 0, false)
mv.pages.AddPage("main", mv.mainGrid, true, true)
}
func (mv *MainView) GetContent() tview.Primitive {
return mv.pages
}