summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-09-25 23:47:48 -0500
committerJeff Carr <[email protected]>2025-09-25 23:47:48 -0500
commit9e01ff3989e9be99bffbcd9f335d7f221aa6d06e (patch)
treedc2c2d78aaab337c54c81bc2de985450da2c8f5a
parent2d5506b5fafd6eea6401ab3b253820c528882574 (diff)
add generic cobol PrintTable()v0.5.11
-rw-r--r--generateGui.go9
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)")