Skip to content
Snippets Groups Projects
Commit b04cea16 authored by Malte Bauch's avatar Malte Bauch
Browse files

refactoring struct

- commandsListView
- mainView
-resultAndInputView
parent acbdc480
No related branches found
No related tags found
3 merge requests!90Develop,!59Resolve "Simple ncurse-alike cli to manage gosdn",!53V.0.1.0 Codename Threadbare
......@@ -11,10 +11,10 @@ type CommandListView struct {
}
func NewCommandListView(rootTitle string) *CommandListView {
v := &CommandListView{}
v.rootNode = tview.NewTreeNode(rootTitle)
v.commandsTree = tview.NewTreeView()
v := &CommandListView{
rootNode: tview.NewTreeNode(rootTitle),
commandsTree: tview.NewTreeView(),
}
v.commandsTree.
SetRoot(v.rootNode).
SetTitle("Commands").
......
......@@ -10,14 +10,14 @@ type MainView struct {
}
func NewMainView() *MainView {
v := &MainView{}
v.pages = tview.NewPages()
v.resultAndInputView = NewResultAndInputView()
v.commandsListView = NewCommandListView("")
v := &MainView{
pages: tview.NewPages(),
mainFlexBox: createFlexBox(tview.FlexColumn),
commandsListView: NewCommandListView(""),
resultAndInputView: NewResultAndInputView(),
}
v.commandsListView.GetCommands("../")
v.mainFlexBox = createFlexBox(tview.FlexColumn)
commandsFlexBox := createFlexBox(tview.FlexRow)
commandsFlexBox.AddItem(v.commandsListView.GetContent(), 0, 40, true)
......
......@@ -10,8 +10,9 @@ type ResultAndInputView struct {
}
func NewResultAndInputView() *ResultAndInputView {
v := &ResultAndInputView{}
v.resultAndInputView = tview.NewTextView()
v := &ResultAndInputView{
resultAndInputView: tview.NewTextView(),
}
v.resultAndInputView.
SetDynamicColors(true).
SetRegions(true).
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment