From 133ed30192bce5e2b10a993aaa17d26a11bed93f Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 31 May 2019 23:45:53 -0700 Subject: rearrange some code Signed-off-by: Jeff Carr --- gui.go | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'gui.go') diff --git a/gui.go b/gui.go index ec5688f..45b61f3 100644 --- a/gui.go +++ b/gui.go @@ -10,6 +10,8 @@ import pb "git.wit.com/wit/witProtobuf" import "github.com/davecgh/go-spew/spew" +// THIS IS CLEAN (all that is left is the 'createAddVmBox') + func InitColumns(mh *TableData, parts []TableColumnData) { tmpBTindex := 0 humanID := 0 @@ -284,3 +286,34 @@ func SetText(box *GuiBox, name string, value string) error { log.Println("gui.SetText() END") return nil } + +// makeEntryBox(box, "hostname:", "blah.foo.org") { +func MakeEntryVbox(box *GuiBox, a string, startValue string, edit bool, action string) *GuiEntry { + // Start 'Nickname' vertical box + vboxN := ui.NewVerticalBox() + vboxN.SetPadded(true) + vboxN.Append(ui.NewLabel(a), false) + + e := defaultMakeEntry(startValue, edit, action) + + vboxN.Append(e.UiEntry, false) + box.UiBox.Append(vboxN, false) + // End 'Nickname' vertical box + + return e +} + +func MakeEntryHbox(box *GuiBox, a string, startValue string, edit bool, action string) *GuiEntry { + // Start 'Nickname' vertical box + hboxN := ui.NewHorizontalBox() + hboxN.SetPadded(true) + hboxN.Append(ui.NewLabel(a), false) + + e := defaultMakeEntry(startValue, edit, action) + hboxN.Append(e.UiEntry, false) + + box.UiBox.Append(hboxN, false) + // End 'Nickname' vertical box + + return e +} -- cgit v1.2.3