summaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-01-18 00:05:54 -0600
committerJeff Carr <[email protected]>2024-01-18 00:05:54 -0600
commit3ea3dd10db0e728240fc659bdd33c622d33e46b4 (patch)
tree5bf7a6058db46c08e8e074380f05cadf02f9aef5 /common.go
initial commitv0.0.1
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'common.go')
-rw-r--r--common.go35
1 files changed, 35 insertions, 0 deletions
diff --git a/common.go b/common.go
new file mode 100644
index 0000000..2ae4f9e
--- /dev/null
+++ b/common.go
@@ -0,0 +1,35 @@
+package tree
+
+import (
+ "go.wit.com/lib/widget"
+)
+
+func (n *Node) GetProgName() string {
+ return n.State.ProgName
+}
+
+func (n *Node) GetValue() any {
+ return n.State.Value
+}
+
+func (n *Node) Bool() bool {
+ return widget.GetBool(n.State.Value)
+}
+
+func (n *Node) String() string {
+ return widget.GetString(n.State.Value)
+}
+
+/* avoid this function name as confusing
+func (n *Node) GetText() string {
+ return widget.GetString(n.State.Value)
+}
+*/
+
+func (n *Node) SetValue(a any) {
+ n.State.Value = a
+}
+
+func (n *Node) GetLabel() string {
+ return n.State.Label
+}