lots of code cleanup and debugging work
This commit is contained in:
parent
ebb03139bb
commit
e4f0524bdf
5
debug.go
5
debug.go
|
@ -16,14 +16,15 @@ func (w *guiWidget) dumpTree(s string) {
|
|||
log.Log(ERROR, "dump w.TK == nil", w.node.WidgetId, w.WidgetType, w.String())
|
||||
return
|
||||
}
|
||||
w.showWidgetPlacement("dumpTree() " + s)
|
||||
w.dumpWidget("dumpTree() " + s)
|
||||
|
||||
for _, child := range w.children {
|
||||
child.dumpTree(s)
|
||||
}
|
||||
}
|
||||
|
||||
func (w *guiWidget) showWidgetPlacement(s string) {
|
||||
// a standard function to print out information about a widget
|
||||
func (w *guiWidget) dumpWidget(s string) {
|
||||
var s1 string
|
||||
var pId int
|
||||
if w.node.Parent == nil {
|
||||
|
|
|
@ -164,17 +164,18 @@ func theLetterD(g *gocui.Gui, v *gocui.View) error {
|
|||
}
|
||||
|
||||
func theHelp(g *gocui.Gui, v *gocui.View) error {
|
||||
if showHelp {
|
||||
if me.showHelp {
|
||||
helplayout()
|
||||
showHelp = false
|
||||
me.showHelp = false
|
||||
if me.dropdownV == nil {
|
||||
log.Info("FIXME: MADE me.dropdownV AGAIN")
|
||||
me.dropdownV = makeDropdownView("addWidget() ddview")
|
||||
}
|
||||
me.dropdownV.Show()
|
||||
// me.dropdownV.Show()
|
||||
} else {
|
||||
me.baseGui.DeleteView("help")
|
||||
showHelp = true
|
||||
me.dropdownV.Hide()
|
||||
me.showHelp = true
|
||||
// me.dropdownV.Hide()
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
|
|
@ -35,7 +35,8 @@ func mouseMove(g *gocui.Gui) {
|
|||
|
||||
if me.supermouse {
|
||||
for _, tk := range findByXY(w, h) {
|
||||
log.Log(GOCUI, fmt.Sprintf("findByXY() mouseMove() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
|
||||
tk.dumpWidget("findByXY()")
|
||||
// log.Log(GOCUI, fmt.Sprintf("findByXY() mouseMove() %s wId=%d cuiName=%s at (%d,%d)", tk.WidgetType, tk.node.WidgetId, tk.cuiName, w, h))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
2
find.go
2
find.go
|
@ -85,7 +85,7 @@ func findUnderMouse() *guiWidget {
|
|||
if w.WidgetType == widget.Checkbox {
|
||||
return w
|
||||
}
|
||||
w.showWidgetPlacement("findUnderMouse() found something unknown")
|
||||
w.dumpWidget("findUnderMouse() found something unknown")
|
||||
found = w
|
||||
}
|
||||
// maybe something else was found
|
||||
|
|
1
init.go
1
init.go
|
@ -1,4 +1,3 @@
|
|||
//gjcarro:pjcarrlugin
|
||||
// Copyright 2017-2025 WIT.COM Inc. All rights reserved.
|
||||
// Use of this source code is governed by the GPL 3.0
|
||||
|
||||
|
|
|
@ -29,7 +29,6 @@ import (
|
|||
var me config
|
||||
|
||||
var showDebug bool = true
|
||||
var showHelp bool = true
|
||||
var redoWidgets bool = true
|
||||
|
||||
// This is the window that is currently active
|
||||
|
@ -100,6 +99,7 @@ type config struct {
|
|||
writeMutex sync.Mutex // TODO: writeMutex protects locks the write process
|
||||
fakefile *FakeFile // JUNK? used to attempt to write to the stdout window
|
||||
dtoggle bool // is a dropdown or combobox currently active?
|
||||
showHelp bool // toggle boolean for the help menu (deprecate?)
|
||||
|
||||
// debugging things
|
||||
ecount int // counts how many mouse and keyboard events have occurred
|
||||
|
|
|
@ -93,5 +93,5 @@ func addWidget(n *tree.Node) {
|
|||
}
|
||||
*/
|
||||
}
|
||||
nw.showWidgetPlacement("addWidget()")
|
||||
nw.dumpWidget("in addWidget()")
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ func (w *guiWidget) DrawAt(offsetW, offsetH int) {
|
|||
w.setColor(&colorActiveW)
|
||||
w.placeWidgets(offsetW, offsetH) // compute the sizes & places for each widget
|
||||
w.active = false
|
||||
w.showWidgets()
|
||||
w.dumpWidget("DrawAt()")
|
||||
}
|
||||
|
||||
func (w *guiWidget) toggleTree() {
|
||||
|
@ -36,7 +36,7 @@ func (w *guiWidget) drawTree(draw bool) {
|
|||
if w == nil {
|
||||
return
|
||||
}
|
||||
w.showWidgetPlacement("drawTree()")
|
||||
w.dumpWidget("in drawTree()")
|
||||
if draw {
|
||||
// w.textResize()
|
||||
w.Show()
|
||||
|
@ -77,12 +77,12 @@ func (w *guiWidget) drawView() {
|
|||
|
||||
w.v, err = me.baseGui.SetView(w.cuiName, a, b, c, d, 0)
|
||||
if err == nil {
|
||||
w.showWidgetPlacement("drawView()")
|
||||
w.dumpWidget("drawView() err")
|
||||
log.Log(ERROR, "drawView() internal plugin error err = nil")
|
||||
return
|
||||
}
|
||||
if !errors.Is(err, gocui.ErrUnknownView) {
|
||||
w.showWidgetPlacement("drawView()")
|
||||
w.dumpWidget("drawView() err")
|
||||
log.Log(ERROR, "drawView() internal plugin error error.IS()", err)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue