summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--find.go4
-rw-r--r--init.go2
-rw-r--r--table.go13
3 files changed, 18 insertions, 1 deletions
diff --git a/find.go b/find.go
index 6b22ad3..a109271 100644
--- a/find.go
+++ b/find.go
@@ -10,6 +10,10 @@ func FindWidgetId(id int) *Node {
return treeRoot.FindWidgetId(id)
}
+func FindWidgetById(id int) *Node {
+ return treeRoot.FindWidgetId(id)
+}
+
// searches the binary tree for a WidgetId
func (n *Node) FindWidgetId(id int) *Node {
if n == nil {
diff --git a/init.go b/init.go
index 8122cca..a0d7ec6 100644
--- a/init.go
+++ b/init.go
@@ -68,7 +68,7 @@ func (t *TreeInfo) ConfigFind(n string) (string, error) {
if n == r.Name {
return r.Value, nil
}
- log.Info("toolkit config", r.Plugin, r.Name, r.Value, n)
+ // log.Info("toolkit config no-match on", r.Plugin, r.Name, r.Value, n)
}
return "", fmt.Errorf("toolkit config %s not found", n)
}
diff --git a/table.go b/table.go
index c374d2f..7e1ad4f 100644
--- a/table.go
+++ b/table.go
@@ -307,6 +307,19 @@ func (me *TreeInfo) addTableRow(t *guipb.Table, grid *Node, name string, w int)
return false
}
+// returns true if widget is in a table
+func (n *Node) InTable() bool {
+ // log.Info("InTable() parent id =", n.ParentId)
+ grid := FindWidgetById(int(n.ParentId))
+ if grid != nil {
+ if grid.WidgetType == widget.Grid {
+ return true
+ }
+ }
+
+ return false
+}
+
func dumpTable(t *guipb.Table) {
for i, o := range t.Order {
log.Info("got order:", t.Title, i, o)