This commit is contained in:
Jeff Carr 2025-02-05 17:31:56 -06:00
parent efebe00640
commit 546a4e022b
2 changed files with 4 additions and 28 deletions

View File

@ -93,35 +93,11 @@ func addDropdown() *tree.Node {
return addDropdownNew(-222) return addDropdownNew(-222)
} }
var notsure *guiWidget
// use this to test code ideas // use this to test code ideas
func theNotsure(g *gocui.Gui, v *gocui.View) error { func theNotsure(g *gocui.Gui, v *gocui.View) error {
log.Info("got keypress 2. now what?") log.Info("got keypress 2. now what?")
w, h := g.MousePosition() // w, h := g.MousePosition()
redoWindows(w, h) redoWindows(1, -1)
// 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 {
}
}
*/
return nil return nil
} }

View File

@ -73,8 +73,8 @@ func redoWindows(nextW int, nextH int) {
win.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH)) win.dumpWidget(fmt.Sprintf("redoWindowsE (%d,%d)", nextW, nextH))
// increment the width for the next window // increment the width for the next window
nextW += 40 nextW += win.gocuiSize.Width() + 10
nextH += 10 // nextH += 10
} }
} }