From f72c88dafe534e8a9c0b2001da08a3fbd26de80e Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Sun, 31 Oct 2021 12:20:20 -0500 Subject: [PATCH] NODE: walking Signed-off-by: Jeff Carr --- entry.go | 13 +++++++++++++ window.go | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/entry.go b/entry.go index b2ef8f4..c24fe50 100644 --- a/entry.go +++ b/entry.go @@ -40,6 +40,19 @@ func (b *GuiBox) GetText(name string) string { return e.UiEntry.Text() } +func (n *Node) SetText(value string) error { + log.Println("gui.SetText() value =", value) + if (n.uiText == nil) { + n.uiText.SetText(value) + return nil + } + if (n.uiButton == nil) { + n.uiButton.SetText(value) + return nil + } + return nil +} + func SetText(box *GuiBox, name string, value string) error { if (box == nil) { return fmt.Errorf("gui.SetText() ERROR box == nil") diff --git a/window.go b/window.go index 8598ec4..40c4443 100644 --- a/window.go +++ b/window.go @@ -77,9 +77,9 @@ func makeNode(parent *Node, title string, x int, y int) *Node { // panic("gui.makeNode() after NodeMap()") return &node } else { - panic("gui.makeNode() before Append()") + // panic("gui.makeNode() before Append()") parent.Append(&node) - panic("gui.makeNode() after Append()") + // panic("gui.makeNode() after Append()") } node.parent = parent return &node