From d5be773817445f19b98267d69849571fc9d84390 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 28 Jan 2024 11:07:51 -0600 Subject: builds and runs Signed-off-by: Jeff Carr --- color.go | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) (limited to 'color.go') diff --git a/color.go b/color.go index 4c9ffe6..e02e747 100644 --- a/color.go +++ b/color.go @@ -6,7 +6,6 @@ import ( "github.com/awesome-gocui/gocui" "go.wit.com/log" - "go.wit.com/toolkits/tree" ) //w.v.SelBgColor = gocui.ColorCyan @@ -67,10 +66,7 @@ var colorNone colorT = colorT{none, none, none, none, none, "debug none"} // TODO: maybe enough of us could actually do that if we made it a goal. // TODO: start with riscv boards and fix it universally there // TODO: so just a small little 'todo' item here -func setColor(n *tree.Node, newColor *colorT) { - var tk *guiWidget - tk = n.TK.(*guiWidget) - +func (tk *guiWidget) setColor(newColor *colorT) { if tk.color == newColor { // nothing to do since the colors have nto changed return @@ -87,15 +83,11 @@ func setColor(n *tree.Node, newColor *colorT) { tk.recreateView() } -func setDefaultWidgetColor(n *tree.Node) { - var w *guiWidget - w = n.TK.(*guiWidget) +func (w *guiWidget) setDefaultWidgetColor() { w.showView() } -func setDefaultHighlight(n *tree.Node) { - var w *guiWidget - w = n.TK.(*guiWidget) +func (w *guiWidget) setDefaultHighlight() { if w.v == nil { log.Log(ERROR, "SetColor() failed on view == nil") return @@ -117,8 +109,8 @@ func (w *guiWidget) redoColor(draw bool) { } log.Sleep(.05) - setDefaultHighlight(w.node) - setDefaultWidgetColor(w.node) + w.setDefaultHighlight() + w.setDefaultWidgetColor() for _, child := range w.children { child.redoColor(draw) -- cgit v1.2.3