diff options
| author | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-17 21:31:49 -0600 |
| commit | 841e6252c95244f0ee7faf2c01d33f69a8ab483a (patch) | |
| tree | ef400228622b87611168db2227269ba7fd56625d /tree/common.go | |
| parent | ba95c13799740b5f55541fc5e8ab9f1d34f7e421 (diff) | |
common tree package for toolkitsv0.12.4
This update provides *lots* of toolkit updates. This will allow
the next step of debugging the gocui toolkit to make it work
again. There are new common routines for handling the plugin
channel communication
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'tree/common.go')
| -rw-r--r-- | tree/common.go | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/tree/common.go b/tree/common.go new file mode 100644 index 0000000..24992de --- /dev/null +++ b/tree/common.go @@ -0,0 +1,35 @@ +package tree + +import ( + "go.wit.com/gui/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 +} |
