parent
c80f805bff
commit
f72c88dafe
13
entry.go
13
entry.go
|
@ -40,6 +40,19 @@ func (b *GuiBox) GetText(name string) string {
|
||||||
return e.UiEntry.Text()
|
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 {
|
func SetText(box *GuiBox, name string, value string) error {
|
||||||
if (box == nil) {
|
if (box == nil) {
|
||||||
return fmt.Errorf("gui.SetText() ERROR box == nil")
|
return fmt.Errorf("gui.SetText() ERROR box == nil")
|
||||||
|
|
|
@ -77,9 +77,9 @@ func makeNode(parent *Node, title string, x int, y int) *Node {
|
||||||
// panic("gui.makeNode() after NodeMap()")
|
// panic("gui.makeNode() after NodeMap()")
|
||||||
return &node
|
return &node
|
||||||
} else {
|
} else {
|
||||||
panic("gui.makeNode() before Append()")
|
// panic("gui.makeNode() before Append()")
|
||||||
parent.Append(&node)
|
parent.Append(&node)
|
||||||
panic("gui.makeNode() after Append()")
|
// panic("gui.makeNode() after Append()")
|
||||||
}
|
}
|
||||||
node.parent = parent
|
node.parent = parent
|
||||||
return &node
|
return &node
|
||||||
|
|
Loading…
Reference in New Issue