summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--eventBindings.go3
-rw-r--r--plugin.go21
-rw-r--r--treeAdd.go9
-rw-r--r--window.go2
4 files changed, 3 insertions, 32 deletions
diff --git a/eventBindings.go b/eventBindings.go
index 727ee70..fc4b708 100644
--- a/eventBindings.go
+++ b/eventBindings.go
@@ -144,9 +144,8 @@ 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?")
- wRoot := me.treeRoot.TK.(*guiWidget)
w, h := g.MousePosition()
- wRoot.redoWindows(w, h)
+ redoWindows(w, h)
// closes anything under your mouse
if notsure == nil {
// notsure = makeDropdownView("addWidget() notsure")
diff --git a/plugin.go b/plugin.go
index a311930..7934d83 100644
--- a/plugin.go
+++ b/plugin.go
@@ -115,8 +115,6 @@ func newaction(n *tree.Node, atype widget.ActionType) {
w.deleteNode()
}
n.DeleteNode()
- wRoot := me.treeRoot.TK.(*guiWidget)
- wRoot.redoWindows(0, 0)
default:
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()
}
}
-
-/*
-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)
- }
-}
-*/
diff --git a/treeAdd.go b/treeAdd.go
index d62e89b..7ca8e40 100644
--- a/treeAdd.go
+++ b/treeAdd.go
@@ -48,19 +48,12 @@ func addWidget(n *tree.Node) {
nw.frame = false
// nw.color = &colorWindow
nw.setColor(&colorWindow)
- wRoot := me.treeRoot.TK.(*guiWidget)
- 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")
- // }
+ redoWindows(0, 0)
hideHelp()
showHelp()
return
case widget.Tab:
nw.color = &colorTab
- // redoWindows(0,0)
return
case widget.Button:
nw.color = &colorButton
diff --git a/window.go b/window.go
index 130c688..83196e2 100644
--- a/window.go
+++ b/window.go
@@ -25,7 +25,7 @@ func (tk *guiWidget) redrawWindow(w int, h int) {
}
// 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() {
win.gocuiSize.w0 = nextW
win.gocuiSize.h0 = nextH