diff options
| author | Jeff Carr <[email protected]> | 2025-09-25 23:47:48 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-09-25 23:47:48 -0500 |
| commit | 9e01ff3989e9be99bffbcd9f335d7f221aa6d06e (patch) | |
| tree | dc2c2d78aaab337c54c81bc2de985450da2c8f5a | |
| parent | 2d5506b5fafd6eea6401ab3b253820c528882574 (diff) | |
add generic cobol PrintTable()v0.5.11
| -rw-r--r-- | generateGui.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/generateGui.go b/generateGui.go index 63dabd7..7699e1c 100644 --- a/generateGui.go +++ b/generateGui.go @@ -109,8 +109,9 @@ func headerGui(w io.Writer, pf *File) { fmt.Fprintln(w, " \"time\"") fmt.Fprintln(w, "") fmt.Fprintln(w, " \"go.wit.com/gui\"") - fmt.Fprintln(w, " \"go.wit.com/lib/protobuf/guipb\"") fmt.Fprintln(w, " \"go.wit.com/log\"") + fmt.Fprintln(w, " \"go.wit.com/lib/cobol\"") + fmt.Fprintln(w, " \"go.wit.com/lib/protobuf/guipb\"") fmt.Fprintln(w, " anypb \"google.golang.org/protobuf/types/known/anypb\"") fmt.Fprintln(w, " timestamppb \"google.golang.org/protobuf/types/known/timestamppb\"") fmt.Fprintln(w, ")") @@ -127,6 +128,12 @@ func guiMain(w io.Writer, FRUITS string, FRUIT string) { fmt.Fprintln(w, " return t") fmt.Fprintln(w, "}") fmt.Fprintln(w, "") + fmt.Fprintln(w, "// formats & prints the table as text to Stdout. a real timesaver!") + fmt.Fprintln(w, "func (t *"+FRUITS+"Table) PrintTable() {") + fmt.Fprintln(w, " t.MakeTable()") + fmt.Fprintln(w, " cobol.PrintTable(t.pb)") + fmt.Fprintln(w, "}") + fmt.Fprintln(w, "") fmt.Fprintln(w, "// force the application to choose the type of data. this allows the GUI plugin to be smarter") fmt.Fprintln(w, "func (t *"+FRUITS+"Table) AddStringFunc(title string, f func(*"+FRUIT+") string) *"+FRUIT+"AnyFunc {") fmt.Fprintln(w, " t.pb.Order = append(t.pb.Order, title)") |
