diff options
Diffstat (limited to 'cmds')
| -rw-r--r-- | cmds/buttonplugin/main.go | 17 | ||||
| -rw-r--r-- | cmds/debug/main.go | 2 | ||||
| -rw-r--r-- | cmds/helloworld/main.go | 2 | ||||
| -rw-r--r-- | cmds/textbox/Makefile | 2 | ||||
| -rw-r--r-- | cmds/textbox/main.go | 32 |
5 files changed, 23 insertions, 32 deletions
diff --git a/cmds/buttonplugin/main.go b/cmds/buttonplugin/main.go index cdd8ef3..6132ed6 100644 --- a/cmds/buttonplugin/main.go +++ b/cmds/buttonplugin/main.go @@ -21,7 +21,7 @@ func main() { // gui.LoadToolkit("default") // panic("WTF gocui not happening") // gui.LoadToolkit("gocui") - gui.Init() +// gui.Init() // buttonWindow() go gui.Main(func () { @@ -57,6 +57,10 @@ func buttonWindow() { w = gui.NewWindow() g = w.NewGroup("buttonGroup") + g.NewButton("hello", func () { + log.Println("world") + }) + g.NewButton("NewButton()", func () { log.Println("new foobar 2. Adding button 'foobar 3'") name := "foobar " + strconv.Itoa(counter) @@ -73,8 +77,12 @@ func buttonWindow() { g.NewGroup(name) }) - g.NewButton("hello", func () { - log.Println("world") + g.NewButton("gui.DebugWindow()", func () { + gui.DebugWindow() + }) + + g.NewButton("gui.GolangDebugWindow()", func () { + gui.GolangDebugWindow() }) g.NewButton("LoadToolkit(andlabs)", func () { @@ -86,7 +94,8 @@ func buttonWindow() { }) g.NewButton("Init()", func () { - gui.Init() + log.Println("gui.Init() is deprecated(?)") + //gui.Init() }) g.NewButton("Main()", func () { diff --git a/cmds/debug/main.go b/cmds/debug/main.go index c0df70b..375ccae 100644 --- a/cmds/debug/main.go +++ b/cmds/debug/main.go @@ -17,7 +17,7 @@ import ( func main() { log.Println("Starting my Control Panel") - gui.Init() +// gui.Init() // go gui.Main(helloworld) go gui.Main(gui.DebugWindow) // go gui.DemoToolkitWindow() diff --git a/cmds/helloworld/main.go b/cmds/helloworld/main.go index 43aa08c..5516340 100644 --- a/cmds/helloworld/main.go +++ b/cmds/helloworld/main.go @@ -7,7 +7,7 @@ import ( ) func main() { - gui.Init() + // gui.Init() gui.Main(helloworld) } diff --git a/cmds/textbox/Makefile b/cmds/textbox/Makefile index de22345..7b0e57d 100644 --- a/cmds/textbox/Makefile +++ b/cmds/textbox/Makefile @@ -1,5 +1,5 @@ run: build - ./textbox --guidebug + ./textbox --gui-debug build-release: go get -v -u -x . diff --git a/cmds/textbox/main.go b/cmds/textbox/main.go index b545d08..b260681 100644 --- a/cmds/textbox/main.go +++ b/cmds/textbox/main.go @@ -4,7 +4,6 @@ package main import ( "os" "log" - "fmt" "git.wit.org/wit/gui" arg "github.com/alexflint/go-arg" ) @@ -12,30 +11,20 @@ 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"` + // GuiDebug bool `help:"open up the wit/gui Debugging Window"` + // GuiDemo bool `help:"open the wit/gui Demo Window"` User string `arg:"env:USER"` } var args struct { - Foo string - Bar bool LogOptions - gui.GuiDebug + gui.GuiArgs } - func main() { arg.MustParse(&args) - fmt.Println(args.Foo, args.Bar, args.User) - - gui.Config.Debug.Debug = args.Debug - /* - gui.Config.Debug.Change = args.DebugChange - gui.Config.Debug.Dump = args.DebugDump - gui.Config.Debug.Node = args.DebugNode - gui.Config.Debug.Tabs = args.DebugTabs - */ + // fmt.Println(args.Foo, args.Bar, args.User) + log.Println("Toolkit = ", args.Toolkit) /* f, err := os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666) @@ -48,14 +37,14 @@ func main() { log.Println("This is a test log entry") */ - gui.Init() + // gui.InitPlugins([]string{"andlabs"}) gui.Main(initGUI) } // This initializes the first window func initGUI() { var w *gui.Node - gui.Config.Title = "Hello World golang wit/gui Window" + gui.Config.Title = "Hello World" gui.Config.Width = 640 gui.Config.Height = 480 gui.Config.Exit = myDefaultExit @@ -65,16 +54,9 @@ func initGUI() { addDemoTab(w, "A Simple Tab Demo") addDemoTab(w, "A Second Tab") - /* - TODO: add these back - if (args.GuiDemo) { - gui.DemoToolkitWindow() - } - if (args.GuiDebug) { gui.DebugWindow() } - */ } func addDemoTab(window *gui.Node, title string) { |
