summaryrefslogtreecommitdiff
path: root/table.go
diff options
context:
space:
mode:
authorJeff Carr <[email protected]>2025-02-18 20:09:38 -0600
committerJeff Carr <[email protected]>2025-02-19 17:39:45 -0600
commit4087d77add8579b0fa0c738830d07ab3af6aad02 (patch)
treed6178e12b695cbf9fadb394f2a6335fb33b703d0 /table.go
parent5f358634a5c881091cd7696e295d935ac11f737a (diff)
work on tables
Diffstat (limited to 'table.go')
-rw-r--r--table.go39
1 files changed, 31 insertions, 8 deletions
diff --git a/table.go b/table.go
index 6d9b145..35d64c9 100644
--- a/table.go
+++ b/table.go
@@ -52,23 +52,46 @@ func RefreshTime(t *time.Duration) {
}
*/
+func NewTable(title string) *NodeTable {
+ t := new(NodeTable)
+ /*
+ t.pb = new(guipb.Table)
+ t.pb.Title = title
+ */
+ t.n = me.rootNode.newNode(title, widget.Table)
+ t.n.label = title
+
+ return t
+}
+
+type NodeColumn struct {
+ Title string
+ Vals []string
+}
+
type NodeTable struct {
- n *Node
- pb *guipb.Table
+ n *Node
+ // pb *guipb.Table
}
-func (t *NodeTable) ShowTable() {
+func (t *NodeTable) ShowTable(pb *guipb.Table) {
+ log.Info("gui.ShowTable")
// make a new action and populate the current node state
a := getNewAction(t.n, widget.Show)
- if t.pb == nil {
- log.Info("error: TablePB == nil")
- return
- }
- a.TablePB, err = t.pb.Marshal()
+ /*
+ if t.pb == nil {
+ log.Info("error: TablePB == nil")
+ return
+ }
+ */
+ nt := guipb.NewTables()
+ nt.Append(pb)
+ a.TablePB, err = nt.Marshal()
if err != nil {
log.Info("unmarshal error", err)
return
}
+ log.Info("send action to plugin", t.n.label, "pb len =", len(a.TablePB))
sendActionToPlugin(a)
/*