summaryrefslogtreecommitdiff
path: root/setText.go
diff options
context:
space:
mode:
Diffstat (limited to 'setText.go')
-rw-r--r--setText.go28
1 files changed, 28 insertions, 0 deletions
diff --git a/setText.go b/setText.go
index eb09640..611f2c6 100644
--- a/setText.go
+++ b/setText.go
@@ -9,6 +9,34 @@ import (
"go.wit.com/widget"
)
+// This will set the visable name for widgets that
+// have text displayed that is not editable by the user
+// For example, a button, window, group, checkbox
+func (n *Node) SetLabel(label string) *Node {
+ switch n.WidgetType {
+ case widget.Checkbox:
+ n.label = label
+ case widget.Button:
+ n.label = label
+ case widget.Label:
+ n.label = label
+ case widget.Group:
+ n.label = label
+ case widget.Window:
+ n.label = label
+ default:
+ }
+
+ n.changed = true
+ log.Log(CHANGE, "SetLabel() value =", label)
+
+ // inform the toolkits
+ sendAction(n, widget.SetText)
+ return n
+}
+
+// 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