summaryrefslogtreecommitdiff
path: root/common.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-05 15:03:11 -0600
committerJeff Carr <[email protected]>2024-02-05 15:03:11 -0600
commitd92457087cb2bdb70c389699e5353187970336dc (patch)
tree6d66039e1382dbbb24a14a0bd5fc54e95c9b43b5 /common.go
parent0f178bfaed2962ad4b0e19c4590c346d4e68c5d4 (diff)
need protobuf herev0.20.0
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'common.go')
-rw-r--r--common.go30
1 files changed, 28 insertions, 2 deletions
diff --git a/common.go b/common.go
index 361c165..274877f 100644
--- a/common.go
+++ b/common.go
@@ -1,6 +1,7 @@
package tree
import (
+ "go.wit.com/log"
"go.wit.com/widget"
)
@@ -8,16 +9,35 @@ 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)
+ return false // widget.GetBool(n.State.Value)
}
func (n *Node) String() string {
- return widget.GetString(n.State.Value)
+ switch n.WidgetType {
+ case widget.Button:
+ return n.State.Label
+ case widget.Window:
+ return n.State.Label
+ case widget.Checkbox:
+ return n.State.Label
+ case widget.Group:
+ return n.State.Label
+ case widget.Label:
+ return n.State.Label
+ case widget.Dropdown:
+ return n.State.CurrentS
+ case widget.Combobox:
+ return n.State.CurrentS
+ }
+ log.Log(TREE, "do not know how to do String() on widget type", n.WidgetType)
+ return ""
}
func (n *Node) ProgName() string {
@@ -34,9 +54,15 @@ func (n *Node) GetText() string {
}
*/
+/*
func (n *Node) SetValue(a any) {
n.State.Value = a
}
+*/
+
+func (n *Node) SetCurrentS(s string) {
+ n.State.CurrentS = s
+}
func (n *Node) GetLabel() string {
return n.State.Label