summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-21 15:37:04 -0600
committerJeff Carr <[email protected]>2025-02-21 15:37:04 -0600
commit2620425629c581462f5bbec64decf23152d05b15 (patch)
tree36fe334cda006f2895d5308b947e5915ea11f8f3
parent2e66d10ffbd4ef5fc5d227a033d5208a261dc5d7 (diff)
add SetParent()v0.0.60v0.0.59v0.0.58
-rw-r--r--generateGui.go11
1 files changed, 10 insertions, 1 deletions
diff --git a/generateGui.go b/generateGui.go
index 8ddba01..23c4bcd 100644
--- a/generateGui.go
+++ b/generateGui.go
@@ -128,10 +128,18 @@ func guiMain(w io.Writer, FRUITS string, FRUIT string) {
fmt.Fprintln(w, " return sf")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
+ fmt.Fprintln(w, "func (mt *"+FRUITS+"Table) SetParent(p *gui.Node) {")
+ fmt.Fprintln(w, " mt.parent = p")
+ fmt.Fprintln(w, "}")
+ fmt.Fprintln(w, "")
fmt.Fprintln(w, "func (mt *"+FRUITS+"Table) ShowTable() {")
fmt.Fprintln(w, " // log.Info(\"ShowTable() SENDING TO GUI\")")
fmt.Fprintln(w, " mt.MakeTable()")
- fmt.Fprintln(w, " gui.ShowTable(mt.pb)")
+ fmt.Fprintln(w, " if mt.parent == nil {")
+ fmt.Fprintln(w, " gui.ShowTable(mt.pb)")
+ fmt.Fprintln(w, " return")
+ fmt.Fprintln(w, " }")
+ fmt.Fprintln(w, " mt.parent.ShowTable(mt.pb)")
fmt.Fprintln(w, "}")
fmt.Fprintln(w, "")
fmt.Fprintln(w, "type "+FRUIT+"StringFunc struct {")
@@ -155,6 +163,7 @@ func guiMain(w io.Writer, FRUITS string, FRUIT string) {
fmt.Fprintln(w, "type "+FRUITS+"Table struct {")
fmt.Fprintln(w, " // gt *gui.NodeTable")
fmt.Fprintln(w, " pb *guipb.Table")
+ fmt.Fprintln(w, " parent *gui.Node")
fmt.Fprintln(w, " x *"+FRUITS+"")
fmt.Fprintln(w, " hostnames []string")
fmt.Fprintln(w, " stringFuncs []*"+FRUIT+"StringFunc")