diff options
| author | Jeff Carr <[email protected]> | 2025-03-25 08:57:01 -0500 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2025-03-25 13:17:00 -0500 |
| commit | 308543c02c1e39ac6b9dd45ae31ab9aa596853e8 (patch) | |
| tree | 16ea1bbfea26b1efa103e0e26bede1a958052d74 | |
| parent | d141b4d308f71418e8d43a58c2e04f9560db3092 (diff) | |
identify widgets in tables
| -rw-r--r-- | find.go | 4 | ||||
| -rw-r--r-- | init.go | 2 | ||||
| -rw-r--r-- | table.go | 13 |
3 files changed, 18 insertions, 1 deletions
@@ -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 { @@ -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) } @@ -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) |
