From a3fc02c2f7e22f92b76ff6db92618be0cf3656a6 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Fri, 21 Oct 2022 11:40:08 -0500 Subject: v0.4.1 set sane toolkit default look and feel autogenerate README.md from doc.go (goreadme cmd) remove passing arguements on a mouse click() make defaults for padding, margin, stretchy, etc add a checkbox widget function rename to NewButton() keep cleaning up toolkit code fix date. I was somehow in the future Signed-off-by: Jeff Carr --- text.go | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'text.go') diff --git a/text.go b/text.go index 6f46998..169f3ec 100644 --- a/text.go +++ b/text.go @@ -1,7 +1,7 @@ package gui import "log" -import "errors" +// import "errors" import "regexp" // functions for handling text related GUI elements @@ -17,10 +17,17 @@ func (n *Node) NewLabel(text string) *Node { return newNode } -func (n *Node) SetText(value string) error { - log.Println("gui.SetText() value =", value) - panic("redo SetText()") - return errors.New("nothing found for gui.Node.SetText()") +func (n *Node) SetText(str string) bool { + log.Println("gui.SetText() value =", str) + if (n.toolkit == nil) { + return false + } + + return n.toolkit.SetText(str) +} + +func (n *Node) GetText() string { + return n.toolkit.GetText() } /* @@ -56,7 +63,3 @@ func normalizeInt(s string) string { log.Println("normalizeInt() s =", clean) return clean } - -func (n *Node) GetText() string { - return n.toolkit.GetText() -} -- cgit v1.2.3