summaryrefslogtreecommitdiff
path: root/setText.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-23 16:51:48 -0600
committerJeff Carr <[email protected]>2024-01-23 16:51:48 -0600
commit5706ff427f266a8ae9d67f02b4d4948748e872b0 (patch)
tree8ff6f5dc71a8797f83c4cf3fe952ab849d777ae1 /setText.go
parenta4a2ccd80592b4c20605e3f22f8c6ca73a7eac77 (diff)
SetText() is just SetValue()v0.13.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'setText.go')
-rw-r--r--setText.go36
1 files changed, 20 insertions, 16 deletions
diff --git a/setText.go b/setText.go
index 6f5bedf..74d70a9 100644
--- a/setText.go
+++ b/setText.go
@@ -3,8 +3,6 @@ package gui
// Common actions for widgets like 'Enable' or 'Hide'
import (
- "errors"
-
"go.wit.com/log"
"go.wit.com/widget"
)
@@ -38,26 +36,29 @@ func (n *Node) SetLabel(label string) *Node {
// What "SetText" means depends on the type of widget
// should this be a different name?
func (n *Node) SetText(text string) *Node {
- if !n.Ready() {
- return n
- }
+ n.SetValue(text)
+ /*
+ if !n.Ready() {
+ return n
+ }
- if n.String() == text {
- // nothing changed
- // return n
- }
- n.value = text
- n.changed = true
- log.Log(CHANGE, "SetText() value =", text)
+ if n.String() == text {
+ // nothing changed
+ // return n
+ }
+ n.value = text
+ n.changed = true
+ log.Log(CHANGE, "SetText() value =", text)
- // inform the toolkits
- sendAction(n, widget.SetText)
+ // inform the toolkits
+ sendAction(n, widget.SetText)
+ */
return n
}
-func (n *Node) SetValue(val any) {
+func (n *Node) SetValue(val any) *Node {
if !n.Ready() {
- return
+ return n
}
n.value = val
@@ -66,8 +67,10 @@ func (n *Node) SetValue(val any) {
// inform the toolkits
sendAction(n, widget.Set)
+ return n
}
+/*
func (n *Node) Set(val any) {
if !n.Ready() {
return
@@ -100,3 +103,4 @@ func (n *Node) Set(val any) {
// inform the toolkits
sendAction(n, widget.Set)
}
+*/