diff --git a/click.go b/click.go index 462a409..4c5e6ae 100644 --- a/click.go +++ b/click.go @@ -183,9 +183,16 @@ func (w *guiWidget) doWidgetClick() { me.myTree.SendUserEvent(w.node) case widget.Dropdown: log.Log(NOW, "do the dropdown here") + var ddItems string + for i, s := range w.vals { + log.Log(NOW, "ddItem:", w.String(), i, s) + ddItems += s + "\n" + } if me.ddview == nil { me.ddview = addDropdown() tk := me.ddview.TK.(*guiWidget) + tk.labelN = ddItems + tk.SetText(ddItems) tk.gocuiSize.w0 = 20 tk.gocuiSize.w1 = 40 tk.gocuiSize.h0 = 10 @@ -201,7 +208,7 @@ func (w *guiWidget) doWidgetClick() { tk.v.Wrap = true tk.v.Frame = true tk.v.Clear() - fmt.Fprint(tk.v, "example.com\nwit.com") + fmt.Fprint(tk.v, ddItems) tk.SetVisible(true) return } @@ -213,16 +220,12 @@ func (w *guiWidget) doWidgetClick() { me.baseGui.DeleteView("ddview") tk.v = nil } else { - var dnsList string - for i, s := range tk.vals { - log.Log(NOW, "AddText()", w.String(), i, s) - dnsList += s + "\n" - } me.ddNode = w.node - log.Log(NOW, "new dns list should be set to:", dnsList) - tk.labelN = dnsList - tk.SetText(dnsList) + log.Log(NOW, "new dns list should be set to:", ddItems) + tk.labelN = ddItems + tk.SetText(ddItems) tk.SetVisible(true) + fmt.Fprint(tk.v, ddItems) } for i, s := range tk.vals { log.Log(NOW, "AddText()", tk.String(), i, s) diff --git a/mouse.go b/mouse.go index 74426e5..411b4da 100644 --- a/mouse.go +++ b/mouse.go @@ -89,7 +89,7 @@ func makeDropdownView() { tk.v.Wrap = true tk.v.Frame = true tk.v.Clear() - fmt.Fprint(tk.v, "example.com\nwit.com") + fmt.Fprint(tk.v, tk.labelN) } func mouseUp(g *gocui.Gui, v *gocui.View) error { diff --git a/place.go b/place.go index 194e6a5..726e8ed 100644 --- a/place.go +++ b/place.go @@ -87,7 +87,7 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { // h := newR.h1 - newR.h0 // increment straight down - newH += sizeH + newH += sizeH + 1 if sizeW > maxW { maxW = sizeW }