diff options
| author | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2023-03-01 11:35:36 -0600 |
| commit | 8dbf5a09097b7868e9218bf98716c57eac998a10 (patch) | |
| tree | ab3bdfeaf5a59a55de9d2a6661d2d824090491e5 /cmds | |
| parent | f3bb68396afa7452ecf1c8d4744c825a9d81057c (diff) | |
lots cleaner code between the pluginv0.6.1
Queue() around SetText is helping userspace crashing
merge forceDump(bool) into Dump()
debugging output configuration is pretty clean
keep cutting down duplicate things
--gui-verbose flag works
make label "standard" code
add debug.FreeOSMemory()
move the GO language internals to display in the GUI
update push to do tags and go to github.com/wit-go/
remove the other license file
it might be confusing golang.org and github
proper WidgetType
added a Quit() button
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/buttonplugin/Makefile | 4 | ||||
| -rw-r--r-- | cmds/buttonplugin/main.go | 6 | ||||
| -rw-r--r-- | cmds/textbox/main.go | 26 |
3 files changed, 22 insertions, 14 deletions
diff --git a/cmds/buttonplugin/Makefile b/cmds/buttonplugin/Makefile index faa8882..49d190c 100644 --- a/cmds/buttonplugin/Makefile +++ b/cmds/buttonplugin/Makefile @@ -7,8 +7,8 @@ # run: build - ./buttonplugin >/tmp/buttonplugin.log 2>&1 - # ./buttonplugin + # ./buttonplugin >/tmp/buttonplugin.log 2>&1 + ./buttonplugin build-release: go get -v -u -x . diff --git a/cmds/buttonplugin/main.go b/cmds/buttonplugin/main.go index 6132ed6..9ed47fa 100644 --- a/cmds/buttonplugin/main.go +++ b/cmds/buttonplugin/main.go @@ -42,7 +42,7 @@ func main() { log.Println("Main() END") time.Sleep(1 * time.Second) gui.Watchdog() - gui.StandardExit(nil) + gui.StandardExit() } var counter int = 5 @@ -82,7 +82,9 @@ func buttonWindow() { }) g.NewButton("gui.GolangDebugWindow()", func () { - gui.GolangDebugWindow() + // make a seperate window out of this + // w.GolangDebugWindow(false) + w.GolangDebugWindow(true) }) g.NewButton("LoadToolkit(andlabs)", func () { diff --git a/cmds/textbox/main.go b/cmds/textbox/main.go index b260681..44431b7 100644 --- a/cmds/textbox/main.go +++ b/cmds/textbox/main.go @@ -11,8 +11,6 @@ import ( type LogOptions struct { LogFile string Verbose bool - // GuiDebug bool `help:"open up the wit/gui Debugging Window"` - // GuiDemo bool `help:"open the wit/gui Demo Window"` User string `arg:"env:USER"` } @@ -45,11 +43,15 @@ func main() { func initGUI() { var w *gui.Node gui.Config.Title = "Hello World" - gui.Config.Width = 640 - gui.Config.Height = 480 + gui.Config.Width = 642 + gui.Config.Height = 481 gui.Config.Exit = myDefaultExit w = gui.NewWindow() + w.Custom = func () { + log.Println("myDefaultExit(w)") + myDefaultExit(w) + } w.Dump() addDemoTab(w, "A Simple Tab Demo") addDemoTab(w, "A Second Tab") @@ -57,6 +59,9 @@ func initGUI() { if (args.GuiDebug) { gui.DebugWindow() } + if (args.GuiVerbose) { + gui.SetDebug(true) + } } func addDemoTab(window *gui.Node, title string) { @@ -71,18 +76,19 @@ func addDemoTab(window *gui.Node, title string) { dd.AddDropdownName("more 1") dd.AddDropdownName("more 2") dd.AddDropdownName("more 3") - dd.OnChanged = func(*gui.Node) { - s := dd.GetText() - tb.SetText("hello world " + args.User + "\n" + s) - } - g2 = newNode.NewGroup("group 2") tb = g2.NewTextbox("tb") log.Println("tb =", tb.GetText()) - tb.OnChanged = func(*gui.Node) { + tb.Custom = func() { s := tb.GetText() log.Println("text =", s) } + + dd.Custom = func() { + s := dd.GetText() + log.Println("hello world " + args.User + "\n" + s + "\n") + tb.SetText("hello world " + args.User + "\n" + s + "\n") + } } func myDefaultExit(n *gui.Node) { |
