From 9e01ff3989e9be99bffbcd9f335d7f221aa6d06e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Thu, 25 Sep 2025 23:47:48 -0500 Subject: add generic cobol PrintTable() --- generateGui.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)") -- cgit v1.2.3