Newer
Older
"code.fbi.h-da.de/cocsn/gosdn/cmd/gosdn-tview/app"
//ResultAndInputView is an application view to display different other views.
//Depending on the required features the views are changed.
pages *tview.Pages
resultView *tview.TextView
pndInputView *AddPNDView
consoleLogView *ConsoleLogView
//NewResultAndInputView creates a new ResultAndInputView
func NewResultAndInputView(app *app.App) *ResultAndInputView {
pages: tview.NewPages(),
pndInputView: NewAddPNDView(app),
resultView: tview.NewTextView(),
consoleLogView: NewConsoleLogView(),
SetDynamicColors(true).
SetRegions(true).
SetScrollable(true).
SetTitle("Result").
rv.pages.
AddPage("result", rv.resultView, true, true).
AddPage("addPND", rv.pndInputView.GetContent(), true, false).
AddPage("log", rv.consoleLogView.GetContent(), true, false)
//GetContent returns the tview.Primitive belonging to the ResultAndInputView
func (rv *ResultAndInputView) GetContent() tview.Primitive {
//ChangeContentView changes the current content (tview.Primitive) that is visible
//inside this view
func (rv *ResultAndInputView) ChangeContentView(s string) {
rv.pages.SwitchToPage(s)
//SetContent sets new string content for the ResultAndInputView
rv.resultView.Clear()
rv.resultView.SetText(s)