diff options
Diffstat (limited to 'common.go')
| -rw-r--r-- | common.go | 30 |
1 files changed, 28 insertions, 2 deletions
@@ -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 |
