diff options
| author | Jeff Carr <[email protected]> | 2025-03-03 03:45:36 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-03 03:45:36 -0600 |
| commit | 9ef16c1bf2bfc1e00163b461779383c809efff9f (patch) | |
| tree | 2118e9596fbf3dce620766572aa203f87841a334 /stdoutShow.go | |
| parent | da54c0f039fe35aef01dabeaf6267fd4e3ba377d (diff) | |
better tree init()
Diffstat (limited to 'stdoutShow.go')
| -rw-r--r-- | stdoutShow.go | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/stdoutShow.go b/stdoutShow.go index 68ec55b..4bbf59a 100644 --- a/stdoutShow.go +++ b/stdoutShow.go @@ -161,14 +161,19 @@ func (w stdout) Write(p []byte) (n int, err error) { lines := strings.Split(strings.TrimSpace(string(p)), "\n") me.stdout.outputS = append(me.stdout.outputS, lines...) - fmt.Fprint(outf, string(p)) + if me.outf != nil { + fmt.Fprint(me.outf, string(p)) + } return len(p), nil } func (w *guiWidget) Write(p []byte) (n int, err error) { lines := strings.Split(strings.TrimSpace(string(p)), "\n") - fmt.Fprint(outf, string(p)) + if me.outf != nil { + fmt.Fprint(me.outf, string(p)) + } + if w == nil { me.stdout.outputS = append(me.stdout.outputS, lines...) return len(p), nil @@ -187,7 +192,6 @@ func (w *guiWidget) Write(p []byte) (n int, err error) { // redo this old code v, _ := me.baseGui.View("msg") if v != nil { - // fmt.Fprintln(outf, "found msg") tk.v = v } return len(p), nil |
