diff --git a/eventBindings.go b/eventBindings.go index d664b21..3ca09e2 100644 --- a/eventBindings.go +++ b/eventBindings.go @@ -155,7 +155,7 @@ func theNotsure(g *gocui.Gui, v *gocui.View) error { notsure.node.State.Label = "apple/pear" notsure.makeTK([]string{"apple", "pear"}) } - notsure.MoveToOffset(w+2, h+1) + notsure.MoveToOffset(w+10, h-6) // notsure.SetText("theNotsure") notsure.drawView() notsure.Show() diff --git a/place.go b/place.go index 7ba8a48..31da1fa 100644 --- a/place.go +++ b/place.go @@ -78,6 +78,8 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { switch tk.node.WidgetType { case widget.Window: + startW += 4 + startH += 4 for _, child := range tk.children { child.placeWidgets(startW, startH) sizeW, _ := child.Size() @@ -88,9 +90,9 @@ func (tk *guiWidget) placeWidgets(startW int, startH int) (int, int) { case widget.Tab: case widget.Grid: tk.dumpWidget(fmt.Sprintf("PlaceGridS(%d,%d)", startW, startH)) - // reset the widths and heights maps here - tk.widths = make(map[int]int) // how tall each row in the grid is - tk.heights = make(map[int]int) // how wide each column in the grid is + // if you reset the values here, grid horizontal stacking doesn't work anymore + // tk.widths = make(map[int]int) // how tall each row in the grid is + // tk.heights = make(map[int]int) // how wide each column in the grid is newW, newH := tk.placeGrid(startW, startH) tk.full.w0 = newW tk.full.h0 = newH diff --git a/window.go b/window.go index 99ecea6..b7e3761 100644 --- a/window.go +++ b/window.go @@ -21,10 +21,11 @@ func (tk *guiWidget) redrawWindow(w int, h int) { tk.DrawAt(w, h) tk.setColor(&colorActiveW) // sets the window to Green BG tk.placeWidgets(w, h) // compute the sizes & places for each widget - tk.showWidgets() tk.setFullSize() me.baseGui.SetView(tk.cuiName, tk.gocuiSize.w0, tk.gocuiSize.h0, tk.gocuiSize.w1, tk.gocuiSize.h1, 0) + tk.Show() + tk.showWidgets() } // re-draws the buttons for each of the windows