fix paths

Signed-off-by: Jeff Carr <jcarr@wit.com>
This commit is contained in:
Jeff Carr 2024-01-18 01:34:32 -06:00
parent 939e87c2e9
commit f3d6daa29e
7 changed files with 185 additions and 186 deletions

View File

@ -27,11 +27,11 @@ func ArgDebug() bool {
func init() {
arg.Register(&argDebugger)
full := "go.wit.com/gui/debugger"
full := "go.wit.com/bug/debugger"
short := "bugger"
INFO = log.NewFlag("INFO", false, full, short, "simple debugging Info()")
POLL = log.NewFlag("POLL", false, full, short, "watch the debugger poll things")
CHAN = log.NewFlag("CHAN", true, full, short, "chan() test code output")
WARN = log.NewFlag("WARN", true, full, short, "should warn the user")
CHAN = log.NewFlag("CHAN", true, full, short, "chan() test code output")
WARN = log.NewFlag("WARN", true, full, short, "should warn the user")
}

110
chan.go
View File

@ -7,11 +7,11 @@ package debugger
import (
// "regexp"
// "go.wit.com/gui/toolkit"
"sync"
"runtime"
"github.com/sourcegraph/conc"
"github.com/sourcegraph/conc/stream"
"github.com/sourcegraph/conc/panics"
"github.com/sourcegraph/conc/stream"
"runtime"
"sync"
"go.wit.com/log"
)
@ -60,65 +60,65 @@ func ExampleCatcher(f func()) {
}
func mapStream(
in chan int,
out chan int,
f func(int) int,
in chan int,
out chan int,
f func(int) int,
) {
tasks := make(chan func())
taskResults := make(chan chan int)
tasks := make(chan func())
taskResults := make(chan chan int)
// Worker goroutines
var workerWg sync.WaitGroup
for i := 0; i < 10; i++ {
workerWg.Add(1)
go func() {
defer workerWg.Done()
for task := range tasks {
task()
}
}()
}
// Worker goroutines
var workerWg sync.WaitGroup
for i := 0; i < 10; i++ {
workerWg.Add(1)
go func() {
defer workerWg.Done()
for task := range tasks {
task()
}
}()
}
// Ordered reader goroutines
var readerWg sync.WaitGroup
readerWg.Add(1)
go func() {
defer readerWg.Done()
for result := range taskResults {
item := <-result
out <- item
}
}()
// Ordered reader goroutines
var readerWg sync.WaitGroup
readerWg.Add(1)
go func() {
defer readerWg.Done()
for result := range taskResults {
item := <-result
out <- item
}
}()
// Feed the workers with tasks
for elem := range in {
resultCh := make(chan int, 1)
taskResults <- resultCh
tasks <- func() {
resultCh <- f(elem)
}
}
// Feed the workers with tasks
for elem := range in {
resultCh := make(chan int, 1)
taskResults <- resultCh
tasks <- func() {
resultCh <- f(elem)
}
}
// We've exhausted input.
// Wait for everything to finish
close(tasks)
workerWg.Wait()
close(taskResults)
readerWg.Wait()
// We've exhausted input.
// Wait for everything to finish
close(tasks)
workerWg.Wait()
close(taskResults)
readerWg.Wait()
}
func mapStream2(
in chan int,
out chan int,
f func(int) int,
in chan int,
out chan int,
f func(int) int,
) {
s := stream.New().WithMaxGoroutines(10)
for elem := range in {
elem := elem
s.Go(func() stream.Callback {
res := f(elem)
return func() { out <- res }
})
}
s.Wait()
s := stream.New().WithMaxGoroutines(10)
for elem := range in {
elem := elem
s.Go(func() stream.Callback {
res := f(elem)
return func() { out <- res }
})
}
s.Wait()
}

View File

@ -7,9 +7,9 @@ import (
"fmt"
"sync"
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/lib/gadgets"
"go.wit.com/log"
)
var debugWG *sync.WaitGroup
@ -24,8 +24,8 @@ func DebugGoChannels(p *gui.Node) *gadgets.BasicWindow {
g = w.Box().NewGroup("Channel stuff").Pad()
// var debugWG sync.WaitGroup
g.NewButton("init()", func () {
if (debugNumberChan == nil) {
g.NewButton("init()", func() {
if debugNumberChan == nil {
log.Log(CHAN, "making debugNumberChan channel")
debugNumberChan = make(chan int)
} else {
@ -33,35 +33,35 @@ func DebugGoChannels(p *gui.Node) *gadgets.BasicWindow {
}
debugWG = new(sync.WaitGroup)
})
g.NewButton("go printInt(x) (read x values off the channel)", func () {
debugWG.Add(1)
go printInt(2, "routine1")
debugWG.Add(1)
go printInt(2, "routine2")
g.NewButton("go printInt(x) (read x values off the channel)", func() {
debugWG.Add(1)
go printInt(2, "routine1")
debugWG.Add(1)
go printInt(2, "routine2")
})
g.NewButton("sendNumber(2) (chan <- 2, 4)", func () {
g.NewButton("sendNumber(2) (chan <- 2, 4)", func() {
debugWG.Add(1)
debugWG.Add(1)
go sendNumber(2)
go sendNumber(4)
})
g.NewButton("sendNumber(1) (chan <- 7)", func () {
g.NewButton("sendNumber(1) (chan <- 7)", func() {
debugWG.Add(1)
go sendNumber(7)
})
g.NewButton("send 4 numbers (chan <- int)", func () {
g.NewButton("send 4 numbers (chan <- int)", func() {
log.Log(CHAN, "generateNumbers(4)")
go generateNumbers(4)
})
g.NewButton("debugWG.Done()", func () {
g.NewButton("debugWG.Done()", func() {
log.Log(CHAN, "ran debugWG.Done()")
debugWG.Done()
})
g.NewButton("close chan", func () {
g.NewButton("close chan", func() {
log.Log(CHAN, "close() on", debugNumberChan)
close(debugNumberChan)
})
g.NewButton("print", func () {
g.NewButton("print", func() {
log.Log(CHAN, "waitgroup counter is ?")
})
return w
@ -92,9 +92,9 @@ func printInt(i int, name string) {
tmp := 1
log.Log(CHAN, "START printInt", name, "read debugNumberChan()")
for num := range debugNumberChan {
log.Log(CHAN, "printInt()",name, "read", num, "from channel")
log.Log(CHAN, "printInt()", name, "read", num, "from channel")
debugWG.Done()
if (tmp == i) {
if tmp == i {
return
}
tmp += 1

View File

@ -1,16 +1,16 @@
package debugger
import (
"fmt"
"bytes"
"fmt"
// "os"
"runtime"
"runtime/debug"
"runtime/pprof"
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/lib/gadgets"
"go.wit.com/log"
)
func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
@ -21,46 +21,46 @@ func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
w.Draw()
g = w.Box().NewGroup("Language Internals").Pad()
g.NewButton("ReadModuleInfo()", func () {
g.NewButton("ReadModuleInfo()", func() {
tmp, _ := debug.ReadBuildInfo()
outputTextbox.SetText(tmp.String())
})
g.NewButton("runtime.NumGoroutine()", func () {
g.NewButton("runtime.NumGoroutine()", func() {
buf := new(bytes.Buffer)
pprof.Lookup("goroutine").WriteTo(buf, 1)
outputTextbox.SetText(buf.String())
outputTextbox.AppendText(fmt.Sprintln("runtime.NumGoroutine() = ", runtime.NumGoroutine()))
})
g.NewButton("pprof.Lookup(heap)", func () {
g.NewButton("pprof.Lookup(heap)", func() {
buf := new(bytes.Buffer)
pprof.Lookup("heap").WriteTo(buf, 1)
outputTextbox.SetText(buf.String())
})
g.NewButton("debug.PrintStack(current)", func () {
g.NewButton("debug.PrintStack(current)", func() {
outputTextbox.SetText(string(debug.Stack()))
})
g.NewButton("pprof.Lookup(goroutine)", func () {
g.NewButton("pprof.Lookup(goroutine)", func() {
buf := new(bytes.Buffer)
pprof.Lookup("goroutine").WriteTo(buf, 1)
outputTextbox.SetText(buf.String())
})
g.NewButton("pprof.Lookup(block)", func () {
g.NewButton("pprof.Lookup(block)", func() {
buf := new(bytes.Buffer)
pprof.Lookup("block").WriteTo(buf, 1)
outputTextbox.SetText(buf.String())
})
g.NewButton("pprof.Lookup threadcreate", func () {
g.NewButton("pprof.Lookup threadcreate", func() {
buf := new(bytes.Buffer)
pprof.Lookup("threadcreate").WriteTo(buf, 1)
outputTextbox.SetText(buf.String())
})
g.NewButton("runtime.ReadMemStats()", func () {
g.NewButton("runtime.ReadMemStats()", func() {
outputTextbox.SetText(runtimeReadMemStats())
})
g.NewButton("debug.FreeOSMemory()", func () {
g.NewButton("debug.FreeOSMemory()", func() {
var out string = "Before debug.FreeOSMemory():\n\n"
out += runtimeReadMemStats()
debug.FreeOSMemory()
@ -69,7 +69,7 @@ func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
outputTextbox.SetText(out)
})
g.NewButton("debug.ReadGCStats()", func () {
g.NewButton("debug.ReadGCStats()", func() {
var tmp debug.GCStats
var out string
debug.ReadGCStats(&tmp)
@ -83,11 +83,11 @@ func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
outputTextbox.SetText(out)
})
g.NewButton("debug.SetTraceback('all')", func () {
g.NewButton("debug.SetTraceback('all')", func() {
debug.SetTraceback("all")
})
g.NewButton("panic()", func () {
g.NewButton("panic()", func() {
panic("test")
})
@ -95,36 +95,36 @@ func DebugGolangWindow(p *gui.Node) *gadgets.BasicWindow {
// g.NewLabel("TODO:")
g.NewButton("runtime.Stack(true)", func () {
g.NewButton("runtime.Stack(true)", func() {
// TODO: https://stackoverflow.com/questions/61127053/how-to-list-all-the-running-goroutines-in-a-go-program
// func Stack(buf []byte, all bool) int
})
g.NewButton("debug.SetMemoryLimit(int)", func () {
g.NewButton("debug.SetMemoryLimit(int)", func() {
// TODO:
//debug.SetMemoryLimit(1024 * 1024 * 100)
})
g.NewButton("debug.SetMaxStack(int bytes)", func () {
g.NewButton("debug.SetMaxStack(int bytes)", func() {
// default is apparently 1GB
})
g.NewButton("debug.SetMaxThreads(int)", func () {
g.NewButton("debug.SetMaxThreads(int)", func() {
// default is apparently 10,000
})
g.NewButton("debug.SetTraceback('all')", func () {
g.NewButton("debug.SetTraceback('all')", func() {
debug.SetTraceback("all")
})
// deprecated (probably) by String() implementation within golang
g.NewButton("dumpModuleInfo() (deprecate)", func () {
g.NewButton("dumpModuleInfo() (deprecate)", func() {
outputTextbox.SetText(dumpModuleInfo())
})
og = w.Box().NewGroup("output").Pad()
outputTextbox = og.NewTextbox("outputBox")
outputTextbox.Custom = func () {
outputTextbox.Custom = func() {
log.Log(INFO, "custom TextBox() for golang output a =", outputTextbox.String())
}
@ -143,7 +143,7 @@ func runtimeReadMemStats() string {
out += fmt.Sprintln("frees:", s.Frees)
out += fmt.Sprintln("heap-alloc:", s.HeapAlloc, "bytes")
out += fmt.Sprintln("heap-sys:", s.HeapSys, "bytes")
out += fmt.Sprintln("heap-idle:", s.HeapIdle,"bytes")
out += fmt.Sprintln("heap-idle:", s.HeapIdle, "bytes")
out += fmt.Sprintln("heap-in-use:", s.HeapInuse, "bytes")
out += fmt.Sprintln("heap-released:", s.HeapReleased, "bytes")
out += fmt.Sprintln("heap-objects:", s.HeapObjects)

58
main.go
View File

@ -1,12 +1,12 @@
package debugger
import (
import (
"os"
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/gui/lib/logsettings"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/logsettings"
"go.wit.com/log"
)
/*
@ -14,7 +14,7 @@ import (
*/
func DebugWindow(p *gui.Node) {
if (me != nil) {
if me != nil {
log.Warn("Draw then Toggle() debuging window here")
me.bugWin.Toggle()
return
@ -22,7 +22,7 @@ func DebugWindow(p *gui.Node) {
me = new(debuggerSettings)
me.myGui = p
me.bugWin = gadgets.NewBasicWindow(p,"go.wit.com/gui debug window")
me.bugWin = gadgets.NewBasicWindow(p, "go.wit.com/gui debug window")
me.bugWin.Draw()
DebugWindow2(me.bugWin.Box(), "Debug Tab")
@ -37,13 +37,13 @@ func DebugWindow(p *gui.Node) {
func DebugWindow2(newB *gui.Node, title string) *gui.Node {
var gr *gui.Node
//////////////////////// main debug things //////////////////////////////////
//////////////////////// main debug things //////////////////////////////////
gr = newB.NewGroup("Debugging Windows:")
gr.NewButton("logging", func () {
gr.NewButton("logging", func() {
me.myLS.Toggle()
})
gr.NewButton("Widgets Window", func () {
gr.NewButton("Widgets Window", func() {
if me.widgets == nil {
me.widgets = DebugWidgetWindow(me.myGui)
return
@ -53,58 +53,58 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
gr.NewLabel("Force Quit:")
gr.NewButton("os.Exit()", func () {
gr.NewButton("os.Exit()", func() {
os.Exit(0)
})
//////////////////////// window debugging things //////////////////////////////////
//////////////////////// window debugging things //////////////////////////////////
gr = newB.NewGroup("list things")
gr.NewButton("List toolkits", func () {
gr.NewButton("List toolkits", func() {
dropdownWindow(gr)
bugWin.ListToolkits()
})
gr.NewButton("List Windows", func () {
gr.NewButton("List Windows", func() {
dropdownWindow(gr)
})
gr.NewButton("List Window Widgets", func () {
gr.NewButton("List Window Widgets", func() {
dropdownWindowWidgets(gr)
})
gr = newB.NewGroup("more things")
gr.NewButton("Node.ListChildren(true)", func () {
if (activeWidget == nil) {
gr.NewButton("Node.ListChildren(true)", func() {
if activeWidget == nil {
activeWidget = bugWin
}
activeWidget.ListChildren(true)
})
gr.NewButton("test conc", func () {
gr.NewButton("test conc", func() {
log.Log(WARN, "TODO: fix me")
// makeConc()
})
gr.NewButton("List Plugins", func () {
gr.NewButton("List Plugins", func() {
log.Log(WARN, "TODO: fix me")
/*
for _, aplug := range allPlugins {
log.Log(true, "Loaded plugin:", aplug.name, aplug.filename)
}
for _, aplug := range allPlugins {
log.Log(true, "Loaded plugin:", aplug.name, aplug.filename)
}
*/
})
gr.NewButton("load toolkit 'gocui'", func () {
gr.NewButton("load toolkit 'gocui'", func() {
bugWin.LoadToolkit("gocui")
})
gr.NewButton("load toolkit 'andlabs'", func () {
gr.NewButton("load toolkit 'andlabs'", func() {
bugWin.LoadToolkit("andlabs")
})
gr = newB.NewGroup("Learn GO")
gr.NewButton("GO Language Internals", func () {
gr.NewButton("GO Language Internals", func() {
if me.golang == nil {
me.golang = DebugGolangWindow(me.myGui)
return
@ -114,7 +114,7 @@ func DebugWindow2(newB *gui.Node, title string) *gui.Node {
me.golang.Toggle()
}
})
gr.NewButton("GO Channels debug", func () {
gr.NewButton("GO Channels debug", func() {
if me.gochan == nil {
me.gochan = DebugGoChannels(me.myGui)
return
@ -140,7 +140,7 @@ func dropdownWindow(p *gui.Node) {
log.Log(INFO, "The Window was set to", name)
}
log.Log(INFO, "dd =", dd)
if (activeWidget == nil) {
if activeWidget == nil {
// the debug window doesn't exist yet so you can't display the change
// TODO: make a fake binary tree for this(?)
return
@ -152,7 +152,7 @@ func dropdownWindow(p *gui.Node) {
dd.AddText(child.GetProgName())
// last = child.Name
mapWindows[child.GetProgName()] = child
if (activeWidget == nil) {
if activeWidget == nil {
activeWidget = child
}
}
@ -173,8 +173,8 @@ func dropdownWindowWidgets(p *gui.Node) {
// log.Log("dumpWidget() ", b, listChildrenDepth, defaultPadding, n.id, info)
var addDropdowns func (*gui.Node)
addDropdowns = func (n *gui.Node) {
var addDropdowns func(*gui.Node)
addDropdowns = func(n *gui.Node) {
// s := n.dumpWidget(true)
s := n.GetProgName()
dd.AddText(s)

View File

@ -2,23 +2,23 @@ package debugger
import (
"go.wit.com/gui/gui"
"go.wit.com/gui/gadgets"
"go.wit.com/gui/lib/logsettings"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/gui/logsettings"
)
var me *debuggerSettings
type debuggerSettings struct {
ready bool
hidden bool
err error
ready bool
hidden bool
err error
myGui *gui.Node
bugWin *gadgets.BasicWindow
bugWin *gadgets.BasicWindow
widgets *gadgets.BasicWindow
golang *gadgets.BasicWindow
gochan *gadgets.BasicWindow
golang *gadgets.BasicWindow
gochan *gadgets.BasicWindow
myLS *logsettings.LogSettings
@ -26,6 +26,7 @@ type debuggerSettings struct {
}
var bugWin *gui.Node
/*
// main debugging window
var bugTab *gui.Node

100
widget.go
View File

@ -1,16 +1,15 @@
package debugger
import (
"strconv"
"errors"
"strconv"
"go.wit.com/log"
"go.wit.com/gui/gui"
"go.wit.com/gui/widget"
"go.wit.com/gui/gadgets"
"go.wit.com/lib/gadgets"
"go.wit.com/lib/widget"
"go.wit.com/log"
)
/*
func setActiveWidget(w *gui.Node) {
if (w == nil) {
@ -59,22 +58,21 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
g2 = g.NewGroup("bool B:")
activeLabelNewB = g2.NewCheckbox("tmp bool")
// common things that should work against each widget
g = w.Box().NewGroup("common things")
g.NewButton("Enable()", func () {
g.NewButton("Enable()", func() {
activeWidget.Enable()
})
g.NewButton("Disable()", func () {
g.NewButton("Disable()", func() {
activeWidget.Disable()
})
g.NewButton("Show()", func () {
g.NewButton("Show()", func() {
activeWidget.Show()
})
g.NewButton("Hide()", func () {
g.NewButton("Hide()", func() {
activeWidget.Hide()
})
g.NewButton("Dump()", func () {
g.NewButton("Dump()", func() {
activeWidget.Dump()
})
@ -84,42 +82,42 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
debugAddWidgetButtons(g)
g = w.Box().NewGroup("change things")
g.NewButton("AddText()", func () {
g.NewButton("AddText()", func() {
activeWidget.AddText(activeLabelNewName.String())
/*
activeWidget.S = activeLabelNewName.S
a := newAction(activeWidget, toolkit.AddText)
sendAction(a)
activeWidget.S = activeLabelNewName.S
a := newAction(activeWidget, toolkit.AddText)
sendAction(a)
*/
})
g.NewButton("SetText()", func () {
g.NewButton("SetText()", func() {
activeWidget.SetText(activeLabelNewName.String())
/*
activeWidget.S = activeLabelNewName.String()
a := newAction(activeWidget, toolkit.SetText)
sendAction(a)
activeWidget.S = activeLabelNewName.String()
a := newAction(activeWidget, toolkit.SetText)
sendAction(a)
*/
})
g.NewButton("Margin()", func () {
g.NewButton("Margin()", func() {
activeWidget.Margin()
/*
a := newAction(activeWidget, toolkit.Margin)
sendAction(a)
a := newAction(activeWidget, toolkit.Margin)
sendAction(a)
*/
})
g.NewButton("Unmargin()", func () {
g.NewButton("Unmargin()", func() {
activeWidget.Unmargin()
})
g.NewButton("Pad()", func () {
g.NewButton("Pad()", func() {
activeWidget.Pad()
})
g.NewButton("Unpad()", func () {
g.NewButton("Unpad()", func() {
activeWidget.Unpad()
})
g.NewButton("Move(junk)", func () {
g.NewButton("Move(junk)", func() {
log.Warn("gui.Node Move() not implemented yet")
})
g.NewButton("Delete()", func () {
g.NewButton("Delete()", func() {
activeWidget.Delete(activeWidget)
})
@ -127,7 +125,7 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
activeJunk = w.Box().NewGroup("junk:")
activeJunk.NewLabel("test junk")
if (activeWidget == nil) {
if activeWidget == nil {
setActiveWidget(me.myGui)
}
@ -135,24 +133,24 @@ func DebugWidgetWindow(p *gui.Node) *gadgets.BasicWindow {
}
func debugAddWidgetButtons(n *gui.Node) {
n.NewButton("Dropdown", func () {
n.NewButton("Dropdown", func() {
a := activeWidget.NewDropdown()
a.AddText("this is better than tcl/tk")
a.AddText("make something for tim for qflow")
a.AddText("and for riscv")
a.Custom = func () {
a.Custom = func() {
log.Log(WARN, "custom dropdown() a =", a.GetProgName(), a.String())
}
})
n.NewButton("Combobox", func () {
n.NewButton("Combobox", func() {
a := activeWidget.NewCombobox()
a.AddText("mirrors.wit.com")
a.AddText("go.wit.com")
a.Custom = func () {
a.Custom = func() {
log.Log(WARN, "custom combobox() a =", a.GetProgName(), a.String())
}
})
n.NewButton("Grid", func () {
n.NewButton("Grid", func() {
// Grid numbering by (X,Y)
// -----------------------------
// -- (1,1) -- (2,1) -- (3,1) --
@ -163,25 +161,25 @@ func debugAddWidgetButtons(n *gui.Node) {
debugGrid = activeWidget.NewGrid("tmp grid", 2, 3)
debugGridLabel = debugGrid.NewLabel("mirrors.wit.com")
/*
debugGrid.SetNext(0,1)
debugGrid.NewLabel("foo (0,1)")
debugGrid.SetNext(1,1)
debugGrid.NewLabel("foo (1,1)")
debugGrid.SetNext(2,1)
debugGrid.NewLabel("foo (2,1)")
debugGrid.SetNext(0,1)
debugGrid.NewLabel("foo (0,1)")
debugGrid.SetNext(1,1)
debugGrid.NewLabel("foo (1,1)")
debugGrid.SetNext(2,1)
debugGrid.NewLabel("foo (2,1)")
*/
// SetDebug(false)
DebugWidgetWindow(debugGrid)
})
n.NewButton("Image", func () {
n.NewButton("Image", func() {
activeWidget.NewImage("image")
})
n.NewButton("Box(horizontal)", func () {
n.NewButton("Box(horizontal)", func() {
a := activeWidget.NewBox("hBox", true)
a.NewLabel("hBox")
a.NewLabel("hBox 2")
})
n.NewButton("Box(vertical)", func () {
n.NewButton("Box(vertical)", func() {
a := activeWidget.NewBox("vBox", false)
a.NewLabel("vBox")
a.NewLabel("vBox 2")
@ -211,13 +209,13 @@ func debugAddWidgetButton(n *gui.Node) {
activeLabelNewType.AddText("Color")
activeLabelNewType.AddText("Dialog")
n.NewButton("Add", func () {
name := activeLabelNewName.String()
newX := widget.GetInt(activeLabelNewX.String())
newY := widget.GetInt(activeLabelNewY.String())
newB := widget.GetBool(activeLabelNewB.String())
n.NewButton("Add", func() {
name := activeLabelNewName.String()
newX := widget.GetInt(activeLabelNewX.String())
newY := widget.GetInt(activeLabelNewY.String())
newB := widget.GetBool(activeLabelNewB.String())
if (newY == -1) {
if newY == -1 {
name = name + " (" + strconv.Itoa(activeWidget.NextW) + "," + strconv.Itoa(activeWidget.NextH) + ")"
} else {
// activeWidget.SetNext(newX, newY)
@ -243,19 +241,19 @@ func debugAddWidgetButton(n *gui.Node) {
case "Box":
activeWidget.NewBox(name, newB)
case "Button":
activeWidget.NewButton(name, func () {
activeWidget.NewButton(name, func() {
log.Log(WARN, "got to button", name)
})
case "Checkbox":
a := activeWidget.NewCheckbox("DBG")
a.Custom = func () {
a.Custom = func() {
log.Log(WARN, "custom checkox func a=", a.String())
}
case "Dropdown":
a := activeWidget.NewDropdown()
a.AddText(name + " yay")
a.AddText(name + " haha")
a.Custom = func () {
a.Custom = func() {
log.Log(WARN, "WTF a=", a.String())
}
case "Combobox":