diff options
| author | Jeff Carr <[email protected]> | 2022-10-21 11:40:08 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2022-10-21 11:40:08 -0500 |
| commit | a3fc02c2f7e22f92b76ff6db92618be0cf3656a6 (patch) | |
| tree | 70c05aada2b3acfbb95d1e6e0098291c7f8b6bcf /text.go | |
| parent | b8ef0bb05dc14bc4291f3d156b199fa125cdb9d7 (diff) | |
v0.4.1 set sane toolkit default look and feelv0.4.1
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 <[email protected]>
Diffstat (limited to 'text.go')
| -rw-r--r-- | text.go | 21 |
1 files changed, 12 insertions, 9 deletions
@@ -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() -} |
