summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2024-02-05 07:20:57 -0600
committerJeff Carr <[email protected]>2024-02-05 07:20:57 -0600
commit6291ddc13db10fe5ff18958763193d52de1b44c6 (patch)
treed3738bcb4a2ef69788de9b72b3d6b681afb6f405
parent102dfca3209ca9141313af8ae34a35d3cdb3c4be (diff)
add func Hidden() bool
Signed-off-by: Jeff Carr <[email protected]>
-rw-r--r--common.go4
-rw-r--r--init.go14
2 files changed, 18 insertions, 0 deletions
diff --git a/common.go b/common.go
index 8af469d..66da97c 100644
--- a/common.go
+++ b/common.go
@@ -20,6 +20,10 @@ func (n *Node) String() string {
return widget.GetString(n.State.Value)
}
+func (n *Node) Hidden() bool {
+ return n.State.Hidden
+}
+
/* avoid this function name as confusing
func (n *Node) GetText() string {
return widget.GetString(n.State.Value)
diff --git a/init.go b/init.go
index 79f7241..02d2623 100644
--- a/init.go
+++ b/init.go
@@ -10,6 +10,19 @@ import (
var muAction sync.Mutex
+/*
+func (me *TreeInfo) newAction(a widget.Action) *tree.Node {
+ switch a.ActionType {
+ case widget.Add:
+ n := me.treeRoot.FindWidgetId(a.WidgetId)
+ if n == nil {
+ n := me.AddNode(&a)
+ me.ActionFromChannel(n, a.ActionType)
+ }
+ }
+}
+*/
+
func (me *TreeInfo) catchActionChannel() {
defer func() {
if r := recover(); r != nil {
@@ -30,6 +43,7 @@ func (me *TreeInfo) catchActionChannel() {
} else {
// send this to the toolkit
me.ActionFromChannel(a)
+ // me.newAction(a)
}
muAction.Unlock()
}