it's my memory so I can forget
lots of general improvements ready to fix gocui working on log settings fix the debugger Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
parent
c1b2c4a182
commit
15e9548cf5
3
Makefile
3
Makefile
|
@ -3,6 +3,9 @@
|
|||
all: redomod
|
||||
@echo a 'gui' debugger using the gui
|
||||
|
||||
goimports:
|
||||
goimports -w *.go
|
||||
|
||||
redomod:
|
||||
rm -f go.*
|
||||
goimports -w *.go
|
||||
|
|
10
go.mod
10
go.mod
|
@ -5,11 +5,11 @@ go 1.21.4
|
|||
require (
|
||||
github.com/sourcegraph/conc v0.3.0
|
||||
go.wit.com/dev/alexflint/arg v1.4.5
|
||||
go.wit.com/gui v0.12.17
|
||||
go.wit.com/lib/gadgets v0.12.11
|
||||
go.wit.com/lib/gui/logsettings v0.10.1
|
||||
go.wit.com/log v0.5.5
|
||||
go.wit.com/widget v1.1.5
|
||||
go.wit.com/gui v0.12.19
|
||||
go.wit.com/lib/gadgets v0.12.14
|
||||
go.wit.com/lib/gui/logsettings v0.10.2
|
||||
go.wit.com/log v0.5.6
|
||||
go.wit.com/widget v1.1.6
|
||||
)
|
||||
|
||||
require (
|
||||
|
|
20
go.sum
20
go.sum
|
@ -19,15 +19,15 @@ go.wit.com/dev/alexflint/scalar v1.2.1 h1:loXOcbVnd+8YeJRLey+XXidecBiedMDO00zQ26
|
|||
go.wit.com/dev/alexflint/scalar v1.2.1/go.mod h1:+rYsfxqdI2cwA8kJ7GCMwWbNJvfvWUurOCXLiwdTtSs=
|
||||
go.wit.com/dev/davecgh/spew v1.1.4 h1:C9hj/rjlUpdK+E6aroyLjCbS5MFcyNUOuP1ICLWdNek=
|
||||
go.wit.com/dev/davecgh/spew v1.1.4/go.mod h1:sihvWmnQ/09FWplnEmozt90CCVqBtGuPXM811tgfhFA=
|
||||
go.wit.com/gui v0.12.17 h1:O7fdI8dwDA8/TfkO0RN6LCK05dDiQRTE1Zvek1Imkrc=
|
||||
go.wit.com/gui v0.12.17/go.mod h1:27+THr2a84GZ61KKUuN30WYnYoSsBewllUKc+fnWLto=
|
||||
go.wit.com/lib/gadgets v0.12.11 h1:IgElPe2dFQq9xOQKtAx44Icfzf3tYEPP8NAhlXNUb2A=
|
||||
go.wit.com/lib/gadgets v0.12.11/go.mod h1:Hb/vSiW22hPJjTVA1mShQ6HuqQ7dHGB95WLEfZlPO3M=
|
||||
go.wit.com/lib/gui/logsettings v0.10.1 h1:Dm24jDXu7JXgcEitz3yK4PbNsM4KoteqtreFBfAtvW4=
|
||||
go.wit.com/lib/gui/logsettings v0.10.1/go.mod h1:CTOT91E4hJ2J6ABBedPA497N6cC2o79Dzz4oPASHzR8=
|
||||
go.wit.com/log v0.5.5 h1:bK3b94uVKgev4jB5wg06FnvCFBEapQICTSH2YW+CWr4=
|
||||
go.wit.com/log v0.5.5/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
|
||||
go.wit.com/widget v1.1.5 h1:jx5hJ2WLZJnCcvMuaLHegzpNlzwo+0kOkzsRkzRiB30=
|
||||
go.wit.com/widget v1.1.5/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
|
||||
go.wit.com/gui v0.12.19 h1:OEnsnZnec7Q2jZVjwl413V0wuVAAB4r2mGTY0IouBuw=
|
||||
go.wit.com/gui v0.12.19/go.mod h1:v2VgnOL3dlZ13KclYeedZ1cd20nQdvwjyJTNKvFX3DA=
|
||||
go.wit.com/lib/gadgets v0.12.14 h1:Osh7D8TKJiU5M6tXqERGQwTUt+C5IJ0senkmUAirSek=
|
||||
go.wit.com/lib/gadgets v0.12.14/go.mod h1:Fxc7F8hGskpkWVAsXKhs4ilqUlAnikVXj4yzumtTYa0=
|
||||
go.wit.com/lib/gui/logsettings v0.10.2 h1:xRx0AX1V74kC6CIm+ib6C3ziTcbBjR/Ju3rTLEpQMsw=
|
||||
go.wit.com/lib/gui/logsettings v0.10.2/go.mod h1:v5XUQ6WyNyfScR9oOFhdz8p1wtxCpNWXK3DJ/dbLPVo=
|
||||
go.wit.com/log v0.5.6 h1:rDC3ju95zfEads4f1Zm+QMkqjZ39CsYAT/UmQQs7VP4=
|
||||
go.wit.com/log v0.5.6/go.mod h1:BaJBfHFqcJSJLXGQ9RHi3XVhPgsStxSMZRlaRxW4kAo=
|
||||
go.wit.com/widget v1.1.6 h1:av2miF5vlohMfARA/QGPTPfgW/ADup1c+oeAOKgroPY=
|
||||
go.wit.com/widget v1.1.6/go.mod h1:I8tnD3x3ECbB/CRNnLCdC+uoyk7rK0AEkzK1bQYSqoQ=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
|
|
|
@ -15,10 +15,12 @@ import (
|
|||
var debugWG *sync.WaitGroup
|
||||
var debugNumberChan chan int
|
||||
|
||||
func DebugGoChannels(p *gui.Node) *gadgets.BasicWindow {
|
||||
func DebugGoChannels() *gadgets.BasicWindow {
|
||||
var w *gadgets.BasicWindow
|
||||
var g *gui.Node
|
||||
|
||||
p := gui.TreeRoot()
|
||||
|
||||
w = gadgets.NewBasicWindow(p, "Debug GO Channels")
|
||||
w.Draw()
|
||||
g = w.Box().NewGroup("Channel stuff").Pad()
|
||||
|
|
|
@ -14,7 +14,8 @@ import (
|
|||
"go.wit.com/log"
|
||||
)
|
||||
|
||||
func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||
func DebugGolangWindow() *gadgets.BasicWindow {
|
||||
p := gui.TreeRoot()
|
||||
var w *gadgets.BasicWindow
|
||||
var g, og, outputTextbox *gui.Node
|
||||
|
||||
|
|
18
main.go
18
main.go
|
@ -13,22 +13,20 @@ import (
|
|||
Creates a window helpful for debugging this package
|
||||
*/
|
||||
|
||||
func DebugWindow(p *gui.Node) {
|
||||
func DebugWindow() {
|
||||
if me != nil {
|
||||
log.Warn("Draw then Toggle() debuging window here")
|
||||
me.bugWin.Toggle()
|
||||
return
|
||||
}
|
||||
me = new(debuggerSettings)
|
||||
me.myGui = p
|
||||
me.treeRoot = gui.TreeRoot()
|
||||
|
||||
me.bugWin = gadgets.NewBasicWindow(p, "go.wit.com/gui debug window")
|
||||
me.bugWin = gadgets.NewBasicWindow(me.treeRoot, "go.wit.com/gui debug window")
|
||||
me.bugWin.Make()
|
||||
me.bugWin.Draw()
|
||||
DebugWindow2(me.bugWin.Box(), "Debug Tab")
|
||||
|
||||
// initialize the log settings window (does not display it)
|
||||
me.myLS = logsettings.New(me.myGui)
|
||||
|
||||
if ArgDebug() {
|
||||
log.SetTmp()
|
||||
}
|
||||
|
@ -41,11 +39,11 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
|
|||
gr = newB.NewGroup("Debugging Windows:")
|
||||
|
||||
gr.NewButton("logging", func() {
|
||||
me.myLS.Toggle()
|
||||
logsettings.LogWindow()
|
||||
})
|
||||
gr.NewButton("Widgets Window", func() {
|
||||
if me.widgets == nil {
|
||||
me.widgets = DebugWidgetWindow(me.myGui)
|
||||
me.widgets = DebugWidgetWindow()
|
||||
return
|
||||
}
|
||||
me.widgets.Toggle()
|
||||
|
@ -106,7 +104,7 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
|
|||
|
||||
gr.NewButton("GO Language Internals", func() {
|
||||
if me.golang == nil {
|
||||
me.golang = DebugGolangWindow(me.myGui)
|
||||
me.golang = DebugGolangWindow()
|
||||
return
|
||||
}
|
||||
log.Warn("going to toggle golang window")
|
||||
|
@ -116,7 +114,7 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
|
|||
})
|
||||
gr.NewButton("GO Channels debug", func() {
|
||||
if me.gochan == nil {
|
||||
me.gochan = DebugGoChannels(me.myGui)
|
||||
me.gochan = DebugGoChannels()
|
||||
return
|
||||
}
|
||||
log.Warn("going to toggle go channels window")
|
||||
|
|
|
@ -3,7 +3,6 @@ package debugger
|
|||
import (
|
||||
"go.wit.com/gui"
|
||||
"go.wit.com/lib/gadgets"
|
||||
"go.wit.com/lib/gui/logsettings"
|
||||
)
|
||||
|
||||
var me *debuggerSettings
|
||||
|
@ -13,15 +12,13 @@ type debuggerSettings struct {
|
|||
hidden bool
|
||||
err error
|
||||
|
||||
myGui *gui.Node
|
||||
treeRoot *gui.Node
|
||||
|
||||
bugWin *gadgets.BasicWindow
|
||||
widgets *gadgets.BasicWindow
|
||||
golang *gadgets.BasicWindow
|
||||
gochan *gadgets.BasicWindow
|
||||
|
||||
myLS *logsettings.LogSettings
|
||||
|
||||
mapWindows map[string]*gui.Node // tracks all windows that exist
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@ func setActiveWidget(w *gui.Node) {
|
|||
}
|
||||
*/
|
||||
|
||||
func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
||||
func DebugWidgetWindow() *gadgets.BasicWindow {
|
||||
p := gui.TreeRoot()
|
||||
var w *gadgets.BasicWindow
|
||||
w = gadgets.NewBasicWindow(p, "Widgets")
|
||||
w.Draw()
|
||||
|
@ -126,7 +127,7 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
|
|||
activeJunk.NewLabel("test junk")
|
||||
|
||||
if activeWidget == nil {
|
||||
setActiveWidget(me.myGui)
|
||||
setActiveWidget(me.treeRoot)
|
||||
}
|
||||
|
||||
return w
|
||||
|
@ -169,7 +170,7 @@ func debugAddWidgetButtons(n *gui.Node) {
|
|||
debugGrid.NewLabel("foo (2,1)")
|
||||
*/
|
||||
// SetDebug(false)
|
||||
DebugWidgetWindow(debugGrid)
|
||||
DebugWidgetWindow()
|
||||
})
|
||||
n.NewButton("Image", func() {
|
||||
activeWidget.NewImage("image")
|
||||
|
|
Loading…
Reference in New Issue