still a no

This commit is contained in:
Jeff Carr 2025-02-04 14:45:23 -06:00
parent bf8cbddf1a
commit 8ce9ca882a
4 changed files with 3 additions and 32 deletions

View File

@ -144,9 +144,8 @@ 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?")
wRoot := me.treeRoot.TK.(*guiWidget)
w, h := g.MousePosition() w, h := g.MousePosition()
wRoot.redoWindows(w, h) redoWindows(w, h)
// closes anything under your mouse // closes anything under your mouse
if notsure == nil { if notsure == nil {
// notsure = makeDropdownView("addWidget() notsure") // notsure = makeDropdownView("addWidget() notsure")

View File

@ -115,8 +115,6 @@ func newaction(n *tree.Node, atype widget.ActionType) {
w.deleteNode() w.deleteNode()
} }
n.DeleteNode() n.DeleteNode()
wRoot := me.treeRoot.TK.(*guiWidget)
wRoot.redoWindows(0, 0)
default: default:
log.Log(ERROR, "newaction() UNHANDLED Action Type =", atype, "WidgetType =", n.WidgetType, "Name =", n.ProgName()) log.Log(ERROR, "newaction() UNHANDLED Action Type =", atype, "WidgetType =", n.WidgetType, "Name =", n.ProgName())
} }
@ -183,22 +181,3 @@ func (w *guiWidget) SetText(text string) {
w.Show() w.Show()
} }
} }
/*
func (w *guiWidget) Set(val any) {
if w == nil {
log.Log(WARN, "Set() w == nil. val =", val)
return
}
log.Log(INFO, "Set() value =", val)
w.value = val.(string)
if w.node.WidgetType == widget.Checkbox {
w.node.State.Checked = widget.GetBool(val)
w.setCheckbox()
}
if w.node.WidgetType == widget.Label {
w.labelN = widget.GetString(val)
}
}
*/

View File

@ -48,19 +48,12 @@ func addWidget(n *tree.Node) {
nw.frame = false nw.frame = false
// nw.color = &colorWindow // nw.color = &colorWindow
nw.setColor(&colorWindow) nw.setColor(&colorWindow)
wRoot := me.treeRoot.TK.(*guiWidget) redoWindows(0, 0)
wRoot.redoWindows(0, 0)
// TODO: record the first window here?
// do initial setup of helper widgets here:
// if me.dropdownV == nil {
// me.dropdownV = makeDropdownView("addWidget() ddview2")
// }
hideHelp() hideHelp()
showHelp() showHelp()
return return
case widget.Tab: case widget.Tab:
nw.color = &colorTab nw.color = &colorTab
// redoWindows(0,0)
return return
case widget.Button: case widget.Button:
nw.color = &colorButton nw.color = &colorButton

View File

@ -25,7 +25,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
} }
// re-draws the buttons for each of the windows // re-draws the buttons for each of the windows
func (tk *guiWidget) redoWindows(nextW int, nextH int) { func redoWindows(nextW int, nextH int) {
for _, win := range findWindows() { for _, win := range findWindows() {
win.gocuiSize.w0 = nextW win.gocuiSize.w0 = nextW
win.gocuiSize.h0 = nextH win.gocuiSize.h0 = nextH