diff options
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) { |
