summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventBindings.go28
-rw-r--r--window.go4
2 files changed, 4 insertions, 28 deletions
diff --git a/eventBindings.go b/eventBindings.go
index 47ab97b..4fe6cff 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -93,35 +93,11 @@ func addDropdown() *tree.Node {
return addDropdownNew(-222)
}
-var notsure *guiWidget
-
// use this to test code ideas
func theNotsure(g *gocui.Gui, v *gocui.View) error {
log.Info("got keypress 2. now what?")
- w, h := g.MousePosition()
- redoWindows(w, h)
- // closes anything under your mouse
- if notsure == nil {
- // notsure = makeDropdownView("addWidget() notsure")
- notsure = addDropdownTK(-118)
- notsure.node.State.Label = "apple/pear"
- notsure.makeTK([]string{"apple", "pear"})
- }
- notsure.MoveToOffset(w+10, h-6)
- // notsure.SetText("theNotsure")
- notsure.drawView()
- notsure.Show()
-
- /*
- for _, tk := range findByXY(w, h) {
- // vx0, vy0, vx1, vy1, err := g.ViewPosition("msg")
- log.Log(GOCUI, "verify rect:", tk.v.Name())
- tk.verifyRect()
-
- if tk.node.WidgetType == widget.Stdout {
- }
- }
- */
+ // w, h := g.MousePosition()
+ redoWindows(1, -1)
return nil
}
diff --git a/window.go b/window.go
index 0d25ed2..fa324f2 100644
--- a/window.go
+++ b/window.go
@@ -73,8 +73,8 @@ func redoWindows(nextW int, nextH int) {
win.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH))
// increment the width for the next window
- nextW += 40
- nextH += 10
+ nextW += win.gocuiSize.Width() + 10
+ // nextH += 10
}
}