diff options
| author | Jeff Carr <[email protected]> | 2019-06-01 02:13:18 -0700 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2019-06-01 02:13:18 -0700 |
| commit | 8d920cb2fc841443c8ceeb372411c5ec3422153d (patch) | |
| tree | 6a2a0aa0bd6cecdbeda76e33d5f202d27e49451b /gui.go | |
| parent | 74e62f64055c48495886318d35c33715fb30e2ea (diff) | |
finally able to remove addAccount.go
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'gui.go')
| -rw-r--r-- | gui.go | 42 |
1 files changed, 42 insertions, 0 deletions
@@ -325,3 +325,45 @@ func MakeEntryHbox(box *GuiBox, a string, startValue string, edit bool, action s func NewLabel(box *GuiBox, text string) { box.UiBox.Append(ui.NewLabel(text), false) } + +func AddEntry(box *GuiBox, name string) *GuiEntry { + var ge *GuiEntry + ge = new(GuiEntry) + + ue := ui.NewEntry() + ue.SetReadOnly(false) + ue.OnChanged(func(*ui.Entry) { + log.Println("gui.AddEntry() OK. ue.Text() =", ue.Text()) + }) + box.UiBox.Append(ue, false) + + ge.UiEntry = ue + box.EntryMap[name] = ge + + return ge +} + +func AddGenericBox(gw *GuiWindow) *GuiBox { + var gb *GuiBox + gb = new(GuiBox) + + gb.EntryMap = make(map[string]*GuiEntry) + gb.EntryMap["test"] = nil + + vbox := ui.NewVerticalBox() + vbox.SetPadded(true) + // gw.Box1 = vbox + gb.UiBox = vbox + gb.W = gw + + hbox := ui.NewHorizontalBox() + hbox.SetPadded(true) + vbox.Append(hbox, false) + + return gb +} + +func HorizontalBreak(box *GuiBox) { + tmp := ui.NewHorizontalSeparator() + box.UiBox.Append(tmp, false) +} |
