add SetParent()

This commit is contained in:
Jeff Carr 2025-02-21 15:37:04 -06:00
parent 2e66d10ffb
commit 2620425629
1 changed files with 10 additions and 1 deletions

View File

@ -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")