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