diff options
Diffstat (limited to 'cmds/buttonplugin')
| -rw-r--r-- | cmds/buttonplugin/log.go | 6 | ||||
| -rw-r--r-- | cmds/buttonplugin/main.go | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/cmds/buttonplugin/log.go b/cmds/buttonplugin/log.go index 642ff7b..fb85cfa 100644 --- a/cmds/buttonplugin/log.go +++ b/cmds/buttonplugin/log.go @@ -27,7 +27,11 @@ func init() { arg.MustParse(&args) fmt.Println(args.Foo, args.Bar, args.User) - f1, err = os.OpenFile("/tmp/guilogfile", os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666) + log.Println() + log.Println("STDOUT is now at /tmp/guilogfile") + log.Println("STDOUT is now at /tmp/guilogfile") + log.Println() + f1, err = os.OpenFile(outfile, os.O_RDWR | os.O_CREATE | os.O_APPEND, 0666) if err != nil { log.Fatalf("error opening file: %v", err) } diff --git a/cmds/buttonplugin/main.go b/cmds/buttonplugin/main.go index 0c72c3f..8a76a8b 100644 --- a/cmds/buttonplugin/main.go +++ b/cmds/buttonplugin/main.go @@ -10,13 +10,18 @@ import ( ) var title string = "Demo Plugin Window" +var outfile string = "/tmp/guilogfile" + +// this is broken. delete this func main() { + // this set the xterm and mate-terminal window title. maybe works generally? fmt.Println("\033]0;" + title + "\007") // time.Sleep(5 * time.Second) // var w *gui.Node + // this doesn't seem to work - captureSTDOUT() + // captureSTDOUT() // gui.LoadToolkit("default") // panic("WTF gocui not happening") @@ -57,6 +62,10 @@ func buttonWindow() { w = gui.NewWindow() g = w.NewGroup("buttonGroup") + g.NewButton("this app is old", func () { + }) + g.NewLabel("STDOUT is set to: " + outfile) + g.NewButton("hello", func () { log.Println("world") }) |
